×
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

Custom Property write to Density and Hatch Pattern

Custom Property write to Density and Hatch Pattern

Custom Property write to Density and Hatch Pattern

(OP)
I need to drive the density value and hatch pattern for a SW part file from corresponding Configuration Specific Properties.  Any ideas?

RE: Custom Property write to Density and Hatch Pattern

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.

RE: Custom Property write to Density and Hatch Pattern

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.

All this machinery making modern music can still be open-hearted.

RE: Custom Property write to Density and Hatch Pattern

(OP)
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.

RE: Custom Property write to Density and Hatch Pattern

Take a look at Thread559-36640

Regards

RE: Custom Property write to Density and Hatch Pattern

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  

RE: Custom Property write to Density and Hatch Pattern

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

RE: Custom Property write to Density and Hatch Pattern

(OP)
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.

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