×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Properties
2

Properties

Properties

(OP)
Is there a way to force properties before a save? For example, you get a part from someone, not all the prop. are filled out, you go to detail the thing and you titleblock format has about 10 custom fields(description, mass, treatment...) and you have to go back to the model again and fix problems... And if you don't have ownership then that's even more wasted time... Does anyone have any ideas?

Go Honda!

RE: Properties

I suggest your company setup standard templates for parts/assy/dwgs ... and follow them.
If you don't have ownership, have who does fix it.

Chris
Systems Analyst, I.S.
SolidWorks 06 4.1/PDMWorks 06
AutoCAD 06
ctopher's home (updated 06-21-06)

RE: Properties

(OP)
We do have standard templates, it's the following part that I'm furious about. I just want to be able for other people who create parts not be able to save the part without filling the properties out. like filling out a form on the internet, if you don't have a required field filled out then you can't go any further....

Go Honda!

RE: Properties

SW2007 has a Design Checker module which may be what you need. Though I'm not sure if its use is voluntary or forced.

cheers
Helpful SW websites FAQ559-520
How to find answers ... FAQ559-1091

RE: Properties

There is really no way to do this that I'm aware of.
What we do here is have predefined text in our template properties (rather than leave them blank.  We have things like "Enter Description", Enter Part Number", Etc,  appears in our title blocks (by Default) until someone fills them in.  This kind of reminds the user to do it.

Rob Rodriguez CSWP
President: Northern
Vermont SolidWorks User Group
www.robrodriguez.com (updated 8/12/06)
SW 2006 SP 4.0 / SW 2007 SP 0.0

RE: Properties

That probably would be some API that would run when a new file is opened. I do not know of one that exist.

curious ... "Go Honda!", a sports team or do you work there?

Chris
Systems Analyst, I.S.
SolidWorks 06 4.1/PDMWorks 06
AutoCAD 06
ctopher's home (updated 06-21-06)

RE: Properties

(OP)
Design checker is voluntary.... just tried that. And our formats do have "XXX" in them. It's the reminder thing I'm getting tired of.

Go Honda!

RE: Properties

I doubt there is any way to force people to enter custom properties before saving.  You could write a macro that would "listen" for a save event and cancel the save if properties are not filled out.  However, you would have to figure out some way to force the user to run that macro along with SolidWorks.

RE: Properties

(OP)
Go Honda.... I can only dream of working for them... Just anything Honda... Best engines on earth. (this is where I wait for an american V8 comment.) if it's a car to a lawnmower if it doesn't say Honda somewhere on the engine I won't buy it.

Go Honda!

RE: Properties

I used to have a Civic. Stolen in front of my house. Now I drive a Chevy truck.thumbsup2

If anyone comes up with a macro to pop up the properties window when starting a file, I would be interested also.

Chris
Systems Analyst, I.S.
SolidWorks 06 4.1/PDMWorks 06
AutoCAD 06
ctopher's home (updated 06-21-06)

RE: Properties

(OP)
I think the problem is that the engineers do most the modeling around here, and they do not think of the drawings, which is our deliverable document. I spend more time fixing problems that I do anything else...

Go Honda!

RE: Properties

A very common problem. I had the same issue at my last job. Did training every week then every month to change them, to no use.

Chris
Systems Analyst, I.S.
SolidWorks 06 4.1/PDMWorks 06
AutoCAD 06
ctopher's home (updated 06-21-06)

RE: Properties

Mom had a Honda Civic...ran slightly hot one day....replaed the thermostat.....head cracked a few weeks later.

My 65 Mustang on the otherhand ran hot (thermostat).....didn't realize it (temp gauge broken) and drove the car 30 miles until I did.....evaporated all the water in the radiator....burned up all oil in the engine. Came back...changed the thermostat.....put in 5 quarts of oil....filled the radiator....ran like a champ. No smoke or anything.

Jason

UG NX2.02.2 on Win2000 SP3
SolidWorks 2006 SP5.0 on WinXP SP2

RE: Properties

Watercraft: I'll have my Sea-Doo's (supercharged 215hp) over Honda (turbo) anyday.

Chris
Systems Analyst, I.S.
SolidWorks 06 4.1/PDMWorks 06
AutoCAD 06
ctopher's home (updated 06-21-06)

RE: Properties

Checking properties would be a simple thing for an addin to do.  A macro would not quite do the trick, as macros do not work well for monitoring for events like documents opening and closing.

I could be the world's greatest underachiever, if I could just learn to apply myself.
http://www.EsoxRepublic.com-SolidWorks API VB programming help

RE: Properties

Tick,
Not being argumentative, just curious... why are addins better at event monitoring than macros?

This also made me think... not all of us have access to a VB compiler.  I know you can change your SW launching shortcut to run a macro at SW startup.  How hard would it be to write an add-in that would run whatever macros are listed in some text file when SW loads?  Or, to take it further, have an add-in that allows a user to assign macros to common events without having to write all the event-listening code?  

RE: Properties

No problem, handleman.

True, you can monitor events with macros.  However, macros are not compiled and require more resources to run.  Leave a macro running for an extended period and it almost certainly will affect performance.  This would be especially true if the script failed to properly release objects.

Because macros run slower, it is possible for them to fail to register events.  I have seen this firsthand.  Even compiled programs can miss events, but it happens much more with macros.

As inferred above, one advantage of an addin is that it is compiled, and thus runs faster.  It can run processes on an independent thread, relieving "pressure" on SW processes.

Another significant advantage is that they are triggered automatically with SW startup (as long as they are activated). No "forgetting".  Addins also allow for adding menu items and toolbars.

If you want to, you can create a macro (VBA) and then cnvert it to an addin in VB6.  I have a project to do exactly that on my website.  You can write your ode, then find a local programmer to turn it into an addin with a few simple steps.

I could be the world's greatest underachiever, if I could just learn to apply myself.
http://www.EsoxRepublic.com-SolidWorks API VB programming help

RE: Properties

You could remove the existing "Save" button and replace it with a "Save" that does the same thing but also excutes your code. Some PDMs do this...or rather they have an additional save button that saves the file but also checks the file into the PDM.

Jason

UG NX2.02.2 on Win2000 SP3
SolidWorks 2006 SP5.0 on WinXP SP2

RE: Properties

2
Hi all,

just for fun I got an Example in VBA (swp)..
You can Download this file here http://www.voice-of-europe.com/dotnetnuke/Portals/0/CheckPropsb4Save.zip

and maybe you need to change the VBA references a little bit.

After you had done this close all your open files & run this Sub Main (once), you will notice that nothing happen ... thats not true .. If you try to save or saveas a sldprt or sldasm file without Title Information this macro won't let u save this file... just a message pops up.

maybe it worth a try.

cheers
Michael

RE: Properties

Thanks a lot...STAR FOR YOU! This may have solved most of the issues I have been having as well...now I just need to figure out how to have it liked to property values instead of the summary title.

I was thinking you could try to like it to a blank value, except that realistically all the values have a space as a character. Any Suggestions or ideas?

Boottmills soapbox
SW2006 SP3.0

RE: Properties

Boottmills:
Note that you will have to run this macro every time you run SolidWorks.  It won't stay active from session to session.

To change what it checks you will need to modify the Private Function CheckMyProperties.  This function is inside the class module Klasse1

RE: Properties

Hi,
Its the truth what handleman said ... you need to run it everytime swx start

meanwhlie I still think it's funny so I got another Example ready and btw... don't blame me 4 this code i am in hurry so there is room 4 improvement ..
http://www.voice-of-europe.com/dotnetnuke/Portals/0/CheckPropsb4SaveV2.zip

be4 you run this code .. take a look into sub main and it's case sensitive

cheers
Michael

RE: Properties

That's the other part I need to figure out...Is there a way to use this macro like an addin or convert it to an addin?

Boottmills soapbox
SW2006 SP3.0

RE: Properties

Addin from macro template:
<http://www.esoxrepublic.com/devtools/>

I'm thinking I might take time to do this one myself this weekend.  It would be interesting to see someone else use my template.  If anyone else wants to try...

I could be the world's greatest underachiever, if I could just learn to apply myself.
http://www.EsoxRepublic.com-SolidWorks API VB programming help

RE: Properties

Tick,

If I were to write a VBA version of the event monitor-macro launcher would you be interested in making it into an addin?  I was thinking it would have an mdb database or something that it would read at startup.  The mdb would be set up with a list of all the events that the addin recognizes, and the end user would just add their path to the desired macro corresponding to the event.  The addin itself would just be a bunch of similar functions for every event.  The individual event functions would call one main function, telling that one what event it was.  The main function would check the database to see if a macro was associated with that event and, if so, run that macro.  That way less-experienced VBA programmers would have the ability to trigger macros with events.  

I suppose it could use too many resources to monitor a large number of events.  And if the user links too many complex macros to many events there could be cascading effects, caused by one event triggering a macro, whose running fires other events, triggering other macros.

What do you think?

RE: Properties

An interesting proposition, handleman.

There would be a limit to what is possible.  Model events would probably be limited to active document.  Keeping track of events across all open docs is quite a chore (I've done it).

RE: Properties

Ah, true.  The addin would also have to include code to set the addin's objects to keep them in sync with the active document.  I'm sure the type of user this addin would target wouldn't want to have events trigger macros to act on a document other than the active one.  Also, I suppose there would be no easy way to keep the macro from causing an endless loop.  E.G., a macro which is triggered by an active doc change has code to change the active document.  Sometimes those PEBKAC errors are the most difficult to eliminate... big smile

RE: Properties

I'll see if i can find some time to use your template over the weekend. If I do I'll post my results.

Boottmills soapbox
SW2006 SP3.0

RE: Properties

or maybe not...i'm gonna need VB6 to do this huh?

Boottmills soapbox
SW2006 SP3.0

RE: Properties

Yeah, you will need full VB6 (or VB.NET or C).

RE: Properties

handleman,

I guess the 'cleaner' way to avoid endless loops is using MSMQ or just a simple flag inside the Addin like 'busy' if it's  True then no other Macro will be executed.


@boottmills try Visual Basic Express 2k5 AFAIK it's free to use.

Michael


RE: Properties

VBSpawn,
I had never heard of Visual Studio Express.  Great resource!  Practically speaking, do you have an idea of how limited it is compared to the full Visual Studio?

RE: Properties

Thanks, Stefan!  I was wondering if you could write add-ins with it.  I guess you can't.  [sigh]

RE: Properties

Hi all,

It's allowed and possible to write Addin's with VBE even for companys it's allowed to use free of charge and for Private Persons too.. AFAIK It's allowd to develop with VBE and sell a Programm.

Cheers
Michael

RE: Properties

Hello all,
I also would like to be able to force users to fill in custom properties before being allowed to save or put a file into PDMW. I do not know any programming but am finding this thread very intersesting and will be monitoring it now that I know how to archive them.
peace

Regards,
Dan Olid
SW2006 SP4.1
PDMW 4.0
Cad Designer/PDMW Admin

RE: Properties

Hi OLID,

If you wirte the english manual I will code this AddIn ;o)

cheers
Michael

RE: Properties

I don't remember much of the details, but I looked up a Property manager called PropertyWorks (I think) a while back that would do what you want - it can be set up to pop up a dialog box that requires a user to enter certain information, predetermined by an administrator, before the part/assembly file can be closed.  

RE: Properties

(OP)
So again, a week later, has anyone found a solution? Today I have spent 9 hours correcting other people's work....

Go Honda!

RE: Properties

I am trying to figure out if i can use Visual Basic Express 2k5 to work on an add-in for this. It's slow going since I have more free time than I know what to do with (Denote Sarchasm). Did you have any time this past weekend Tick?

Boottmills soapbox
SW2006 SP3.0

RE: Properties

What about Gildashard's response on 26 Sep 06 22:59?

Quote:

You could remove the existing "Save" button and replace it with a "Save" that does the same thing but also excutes your code.

You could do the same with the menu entry. Seems like a fairly simple solution.

Ken

RE: Properties

Hello again,

Just hold on until the weekend is over.

right now I got this AddIn ready to use, but you'll have to configure it manually by editing a xml file with Notepad.
So I will need a lil bit more time to setup up a Admin Tool.

cheers
Michael



RE: Properties

Here is a macro starter that I wrote for creation of the macro launching addin mentioned earlier.  It would allow novice to intermediate macro writers to easily trigger their macros by SolidWorks events.  

To use it, put the macro path, module name, and procedure name in the EventAssignments.MDB file in the EventList table for the event you want to trigger the macro.  Of course, you will have to tell the macro where the mdb is, either by changing the constant at the top of the form code or by hitting the "Update Path" button on the form itself.

I'm guessing the addin will have to store the data file path in the registry?

Following are some limitations:

1. Running the end-user's macros uses the SldWorks::RunMacro function, which doesn't allow any passing of the arguments generated by the events.
2. Actions (such as saving) can't be cancelled because the user's macro can't return any value to the addin.  Cancelling an event-triggered action requires some value to be set in the event's code.
3. An error caused by a user's macro will crash the main macro.  Not sure if changing to and addin will fix this, but I'm hoping it will.
4. Only events for the application and part/dwg/assembly document objects are handled.  Mostly because other objects' events are beyond the beginner/intermediate level.
5. There is a Busy flag as vbSpawn suggested.  However, Any non-modal macro that is launched (e.g. one with a form) allows the main macro/addin code to continue running, which sets the Busy flag back to False.  There's no way to determine if a user's non-modal macro is finished running.  If the user's macro is non-modal and triggers events by its own running, those events will be seen by the main macro/addin.  

I'm sure there may be others, but this is a start.

Comments?

RE: Properties

Has anyone been able to create an add-in for this, I think this would solve several problems we are having.

Brian

RE: Properties

handleman, this will have to be run once solidworks is started and not like an add-in correct?

Boottmills soapbox
SW2006 SP3.0

RE: Properties

You mean the macro launcher in my last post?  Yes, it would have to be run when SW is started.  I can't turn it into an add-in because we're still running XP service pack 1.  Stupid IS.  Visual Basic Express requires XP SP2.  It would really need to be an add-in anyway because, per the reasons TheTick outlined, addins are better at handling events.  The macro is essentially just one big event handler.  VBSpawn's addin would be better suited to the purpose in the OP, as it will be able to actually cancel the save operation if the user doesn't fill in properties as required.  If my macro were turned into an addin it would be able to launch whatever macro you told it to launch on a Save event, but once the macro finished running the document would still be saved.

RE: Properties

VBSpawn,

Ran a quick test last night...works quite well..thanks!

The only issue I have is since I am using it for only Custom Properties, each value in the template files exist with a "Space" as it's value. This registers as a property and allows it to go thru. So I suppose I'm asking for an enhancement request :).

Any way your next release could have it recognize a "space" as a blank entry field?

Boottmills soapbox
SW2006 SP3.0

RE: Properties

If I understand it right, now space=blank="" ;o) just donwnload it again and replace your existing files ...


cheers
Michael

RE: Properties

Thanks again...the Engineers hate it...the other departments love it...objective completed!

Boottmills soapbox
SW2006 SP3.0

RE: Properties

VBSpawn ...
The "voice-of-europe" link no longer works. Would you mind re-posting? (see also FAQ559-1177 for other upload sites)

cheers

RE: Properties

Hi,
yes I know and I suggested nobody need it (meanwhile)... so I decide to tune it up a lil bit.

I suppose all users will love the new Version... just because I added some new features like a NumberGenerator based upon a simple list file with  prefix / postfix and a numberformatter.. you can attach diffrent ones @ each property.... but its not ready right now... I guess it will be finished next week and you all are welcome for my final test ... no Panic .. its 4 free ...

back to your problem... maybe I can upload this file next Saturday..

btw: additional feature requests r always welcome smile

cheers
Michael

RE: Properties

That's great ... Thank you.

cheers

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources