Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Properties 2

Status
Not open for further replies.

b18c5rjdm

Mechanical
Dec 2, 2005
51
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!
 
Replies continue below

Recommended for you

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
 
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 ..

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

cheers
Michael
 
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
 
See TheTicks post above for add-in creation.

[cheers]
Helpful SW websites faq559-520​
How to find answers ... faq559-1091​
SW2006-SP5 Basic ... No PDM​
 
Addin from macro template:
<
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...

[bat]I could be the world's greatest underachiever, if I could just learn to apply myself.[bat]
-SolidWorks API VB programming help
 
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?
 
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).
 
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... :-D
 
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
 
or maybe not...i'm gonna need VB6 to do this huh?

Boottmills [soapbox]
SW2006 SP3.0
 
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


 
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?
 
Thanks, Stefan! I was wondering if you could write add-ins with it. I guess you can't. [sigh]
 
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
 
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
 
Hi OLID,

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

cheers
Michael
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor