Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Custom Property write to Density and Hatch Pattern

Status
Not open for further replies.

sdb999

Mechanical
May 1, 2003
96
US
I need to drive the density value and hatch pattern for a SW part file from corresponding Configuration Specific Properties. Any ideas?
 
Replies continue below

Recommended for you

As far as I know density and hatch pattern are not configuration specific. I have checked the help on SW2003 but cannot find anything to contradict this.
 
I don't see any immediate solutions. Perhaps writing a macro to incorprate as a "macro feature" that triggers the density and hatch update when configuration is changed. I haven't made a macro feature yet. Perhaps someone out there can elaborate on the nuts-and-bolts of this possibility.

For density, perhaps you could copy the body and assign a density to the copy. Use "Delete Body" to get the original out of the way, and suppress the copies in the various configurations.

[bat]All this machinery making modern music can still be open-hearted.[bat]
 
Although we intend to write from a config. specific property, the values will be the same for the entire file. All configs (parts) must be made from the same raw material, that's our business rule regarding SW usage.

Our PDM (Smarteam) can not write to system properties, only cust/config. specific so after that it's a SW macro that will have to populate the system properties. We populate material part number, description, part number etc. I'm just wanting to get some engineering data too.
 
You could write a macro that is manually activated each time you want the density/crosshatch to update from the Config properties. If you need something more automatic, you may need to do this in the form of a DLL that registers for events in the SolidWorks environment (e.g. saving a file) and responds to those events with an update. The DLL can be run as a SolidWorks add-in. The manually-activated macro is the simpler of these options. The macro feature is too limiting to be useful here.

To set density, you can use:
Part.SetUserPreferenceDoubleValue swMaterialPropertyDensity, density

For crosshatch:
Part.SetUserPreferenceStringValue swMaterialPropertyCrosshatchPattern, sCrossHatchName

Regards,
Brenda
 
One more thought on getting your update process to run automatically...

I forgot that you're using SmarTeam. SmarTeam also employs event-type "hooks" to which you can attach scripts to be run when triggered by certain activities (for example, before check-in, after check-out, etc.) At this point your script that writes values from your custom properties to density and cross-hatch could run.

--Brenda
 
Thanks all, especially Brenda. I'm passing this on to our IT analyst responsible for the Smarteam/SolidWorks integration. My duties are specific to SolidWorks but I have found this forum to be extremely useful for integration/customization information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top