how can I put this rule from assembly

how can I put this rule from assembly

Anonymous
Not applicable
532 Views
7 Replies
Message 1 of 8

how can I put this rule from assembly

Anonymous
Not applicable

how can I put this rule from assembly to see the measurements of real cuts of beams w6x25 w5x16 in the properties

 

SyntaxEditor Code Snippet

' This rule uses the Measured Extents in the Z direction to develop a parameter which will be used in the material list description.

On Error Resume Next

oDoc = ThisDoc.Document
' Verify that the document is fully updated prior to taking measurements.
InventorVb.DocumentUpdate()
' Work features will be included in the extents if they are visible, which interferes with accurate measurement.' Object visibility of work features and surfaces will be set to invisible before the measurements are taken, then returned to their previous state.


'toggle construction surface visibility off
oDoc.ObjectVisibility.AllWorkFeatures = False
oDoc.ObjectVisibility.ConstructionSurfaces = False
oDoc.ObjectVisibility.Sketches = False
oDoc.ObjectVisibility.Sketches3D = False

' Determine the extents of the part in Z direction' Assign the measured value to the LENGTH_DESC user parameter
LENGTH_DESC = Measure.ExtentsHeight

'toggle construction surface visibility on
oDoc.ObjectVisibility.AllWorkFeatures = True
oDoc.ObjectVisibility.ConstructionSurfaces = True
oDoc.ObjectVisibility.Sketches = True
oDoc.ObjectVisibility.Sketches3D = True

' Update so changes are visible to the user
RuleParametersOutput()
InventorVb.DocumentUpdate()

 

 

0 Likes
Accepted solutions (2)
533 Views
7 Replies
Replies (7)
Message 2 of 8

jtylerbc
Mentor
Mentor
Accepted solution

@Anonymous, I'm glad I stumbled across this thread, as I'm the one that wrote the rule.  I guess you found it in another thread (I think I've posted it here a couple of times).

 


@Anonymous wrote:

how can I put this rule from assembly to see the measurements of real cuts of beams w6x25 w5x16 in the properties

This rule is not designed to be put in the assembly.  It should be in the part.  If placed in your assembly, assuming it would run properly, it would give the overall length in the Z direction of the assembly.  You will also need to create a User Parameter called "LENGTH_DESC", or change the name in the code if you prefer a different parameter name.

 

In my case, this rule was added to the "family template" of our custom Content Center structural member families.  That way any time I create a beam, tube, angle, etc. from one of those families, the rule is already there.

Message 3 of 8

Anonymous
Not applicable

but the bad thing is that my template does not enter the part of the frame generator.the pieces have this name ANSI W6x25 00000001.ipt does not allow entering the template by default

0 Likes
Message 4 of 8

jtylerbc
Mentor
Mentor
Accepted solution

"Family Template" is a Content Center customization term.  It is different from a regular part template.

 

For this rule to be used efficiently, you will first need to learn to customize Content Center.  It's a more in-depth topic than can be reasonably explained in just a forum post, but in general, you will need to:

  1. Create a Read/Write library in the Content Center to house your custom data.
  2. Make a copy of the desired"standard" CC family in the new custom library. 
  3. Place a part from your new custom family.  Make any necessary changes to it (adding the Measured Length iLogic rule, formatting your description, and so on).
  4. Replace the original Family Template for the custom CC family with your modified part. 
  5. Make any desired changes to the Family Table, such as changing the file naming scheme.
  6. From then on, you use the customized family instead of the original Autodesk-supplied one.

I suggest you look for articles on these topics in the Inventor help files and online.  That will help give you the background you need to get started, then you can come back here and ask questions if you need help. 

 

It can be a significant amount of work getting this set up, but it pays off in the long run.  My company does steel fabrication, and thanks to this sort of setup, we have not manually typed the description of our typical structural materials (tube, angle, beam, etc.) in years.  Occasionally an odd material type pops up that we have to make manually because we don't have it in the library, but for most projects the structural member descriptions are entirely automated.

Message 5 of 8

Anonymous
Not applicable

Thanks, I did it

0 Likes
Message 6 of 8

Anonymous
Not applicable

How do I run that custom measure rule lenght_desc from various frame generator parts? I open it one by one and execute, because it does not update

0 Likes
Message 7 of 8

jtylerbc
Mentor
Mentor

Did you turn on a trigger for it?

 

I recommend the "Part Geometry Change" trigger for this one.

0 Likes
Message 8 of 8

Anonymous
Not applicable

you have a similar rule for me

0 Likes