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
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
Go Honda!
RE: Properties
RE: Properties
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
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
Go Honda!
RE: Properties
RE: Properties
Go Honda!
RE: Properties
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
Go Honda!
RE: Properties
Chris
Systems Analyst, I.S.
SolidWorks 06 4.1/PDMWorks 06
AutoCAD 06
ctopher's home (updated 06-21-06)
RE: Properties
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
Chris
Systems Analyst, I.S.
SolidWorks 06 4.1/PDMWorks 06
AutoCAD 06
ctopher's home (updated 06-21-06)
RE: Properties
http://www.EsoxRepublic.com-SolidWorks API VB programming help
RE: Properties
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
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.
http://www.EsoxRepublic.com-SolidWorks API VB programming help
RE: Properties
Jason
UG NX2.02.2 on Win2000 SP3
SolidWorks 2006 SP5.0 on WinXP SP2
RE: Properties
just for fun I got an Example in VBA (swp)..
You can Download this file here ht
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
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] soapbox](https://www.tipmaster.com/images/soapbox.gif)
SW2006 SP3.0
RE: Properties
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
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
be4 you run this code .. take a look into sub main and it's case sensitive
cheers
Michael
RE: Properties
Boottmills![[soapbox] soapbox](https://www.tipmaster.com/images/soapbox.gif)
SW2006 SP3.0
RE: Properties
RE: Properties
<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...
http://www.EsoxRepublic.com-SolidWorks API VB programming help
RE: Properties
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
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
RE: Properties
Boottmills![[soapbox] soapbox](https://www.tipmaster.com/images/soapbox.gif)
SW2006 SP3.0
RE: Properties
Boottmills![[soapbox] soapbox](https://www.tipmaster.com/images/soapbox.gif)
SW2006 SP3.0
RE: Properties
RE: Properties
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
http://
Eric
RE: Properties
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
Check this comparison (a bit hard to find, but it is on the site)
htt
Stefan Hamminga
EngIT Solutions
CSWP/Mechanical designer/AI student
RE: Properties
RE: Properties
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
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.
Regards,
Dan Olid
SW2006 SP4.1
PDMW 4.0
Cad Designer/PDMW Admin
RE: Properties
If you wirte the english manual I will code this AddIn ;o)
cheers
Michael
RE: Properties
RE: Properties
Go Honda!
RE: Properties
Boottmills![[soapbox] soapbox](https://www.tipmaster.com/images/soapbox.gif)
SW2006 SP3.0
RE: Properties
You could do the same with the menu entry. Seems like a fairly simple solution.
Ken
RE: Properties
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
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
Brian
RE: Properties
Boottmills![[soapbox] soapbox](https://www.tipmaster.com/images/soapbox.gif)
SW2006 SP3.0
RE: Properties
RE: Properties
http://ww
Steve R.
RE: Properties
and right now here you can download my PropForcer:
http://
I guess it will work with any SWX Version,
if not just let me know.
befor you do anything read the ReadMe1st.rtf file.
I didn't include the source code, just because it's already posted above.
cheers and a great weekend
Michael
RE: Properties
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] soapbox](https://www.tipmaster.com/images/soapbox.gif)
SW2006 SP3.0
RE: Properties
cheers
Michael
RE: Properties
Boottmills![[soapbox] soapbox](https://www.tipmaster.com/images/soapbox.gif)
SW2006 SP3.0
RE: Properties
The "voice-of-europe" link no longer works. Would you mind re-posting? (see also FAQ559-1177 for other upload sites)
RE: Properties
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
cheers
Michael
RE: Properties
RE: Properties
I'll upload v2 next weekend....
ht
cheers
Michael
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!