Use Measure.extentsheight on part from top assembly

Use Measure.extentsheight on part from top assembly

info
Explorer Explorer
581 Views
3 Replies
Message 1 of 4

Use Measure.extentsheight on part from top assembly

info
Explorer
Explorer

Im trying to traverse all referenced parts in an assembly and write the extentsheight to the description.

 

What I'm running into is that Measure.extentsheight is always measuring the extents of the top assembly.

 

Using something like "oDef.MeasureExtentsHeight" doesnt work. I get the message that measure is not a member of the documentclass.

 

Is there a different way to approach this?

Perhaps i could add the script to the referenced parts and have it run from the part itself??

Or truly open the Parts and run Measure..

 

Any ideas are welcome.

0 Likes
582 Views
3 Replies
Replies (3)
Message 2 of 4

theo.bot
Collaborator
Collaborator

You can use the Api instead of the ilogic snippet. Each component (part or assembly) has a rangebox where you can extract the max Z value (height) from. 

check out this bog to get a deeper understanding of the this.: Mod the Machine: Getting the Overall Size of Parts (typepad.com)
Here is a rule that i have to get the extent value for each component and write that info to an iproperty.  

 

0 Likes
Message 3 of 4

info
Explorer
Explorer

@theo.bot  Thanks, looks like i got some reading to do.

Is it true that the rangebox also captures any work features like sketches and planes? That would disturb my workflow.

0 Likes
Message 4 of 4

theo.bot
Collaborator
Collaborator

In the past this was a problem, but when I created this rule recently I noticed that workplanes and sketches didn't affect the values. I tested it several times by adding visible workplanes and visible sketches to a model. I'm not sure when this behaviour is changed.

0 Likes