I've created Costum properties, parameters, to get the outside measure of the parts and it works fine until we create and leave activated a work plane outside the part so it measures not until the end of the part but until the plane.
Any clues how to only measure the part itself?
TIA
FG
Solved! Go to Solution.
Solved by jtylerbc. Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Can you post an example? A part that exhibits this, or a screen shot demonstrating what you are seeing vs. what you want to see?
Chris Benner
Inventor Tube & Pipe, Vault Professional
Cad Tips Tricks & Workarounds | Twitter | LinkedIn
Autodesk University Classes:
Going With The Flow with Inventor Tube and Pipe | Increasing The Volume with Inventor Tube and Pipe | Power of the Autodesk Community | Getting to Know You | Inventor Styles & Standards |Managing Properties with Vault Professional | Vault Configuration | Vault - What is it & Why Do I Need It? | A Little Less Talk - Tube & Pipe Demo | Change Orders & Revisions - Vault, Inventor & AutoCAD | Authoring & Publishing Custom Content
see images please.
I want to put planes but the measure as to be as without because I just want the measure of the part.
Thanks
Are you using ilogic to get these measurements? I see "driving rule" in the parameter screen. If so, I think I know who might be able to help....
Chris Benner
Inventor Tube & Pipe, Vault Professional
Cad Tips Tricks & Workarounds | Twitter | LinkedIn
Autodesk University Classes:
Going With The Flow with Inventor Tube and Pipe | Increasing The Volume with Inventor Tube and Pipe | Power of the Autodesk Community | Getting to Know You | Inventor Styles & Standards |Managing Properties with Vault Professional | Vault Configuration | Vault - What is it & Why Do I Need It? | A Little Less Talk - Tube & Pipe Demo | Change Orders & Revisions - Vault, Inventor & AutoCAD | Authoring & Publishing Custom Content
It seems to me that what ever that perameter is, it is somehow linked to the plane. You might want to link it to a point instead. That way when planes get added this perameter is uneffected.
If this solved your issue please mark this posting "Accept as Solution".
Or if you like something that was said and it was helpful, Kudos are appreciated. Thanks!!!!
Does that accurately get extents if it is an angled surface, or does this only work well for square stuff?
Can't because the part can be out of that point... today can be need the Center Point but tomorrow can be far...
TIA
FG
Hi fgarcia90,
You can toggle the work plane visibility so that it won't be measured:
oDoc = ThisDoc.Document 'toggle work plane visibility For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes If oWorkPlane.Visible = True Then oWorkPlane.Visible = False End If Next Atrav_x = Measure.ExtentsLength Atrav_y = Measure.ExtentsWidth Atrav_z = Measure.ExtentsHeight MessageBox.Show(Atrav_x & vblf & Atrav_y & vblf & Atrav_z, "iLogic")
If you need the work planes that were visible to be toggled back on after measuring, let me know and I'll post another example.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Curtis,
I'd like to see that "toggle back" example. I'm working on a very similar rule, to be used for automatic descriptions of steel plates. I've run into the same sort of issue with workplanes messing up the dimensions.
Fortunately we don't have workplanes off to the side of our plate parts too often - unfortunately, that means on that rare occasion when it DOES happen, nobody would be looking for it until it caused a shop problem.
Do you do alot of spliting? We have set parameters in our parts for length, width, height etc and simply assign the related parameter value for whatever l,w,&h we set for the plates. G_L = 6 for example. The only time I really need inventor to get it for me is if I split a part or otherwise change its overall dimensions outside of the sketch. And sometimes FG will not give the correct length and have to add a sketch to get the length. Otherwise my plate template is set to get whatever the dimensions for the plate as entered.
No, not a lot of splitting, but much revising of plate shapes.
We have been using a method similar to what you are describing, with a construction-geometry box with reference dimensions, which is then constrained to the sketch profile to form a bounding box. The problem I've found is that this is very easily messed up by the user, either by them deleting the construction geometry / dimensions, or forgetting to reconstrain it to the new profile after a shape change.
I'm working on improving upon that method using a rule very similar to what the OP of this thread seems to be doing, with exactly the same problem he is asking about. The rule does what I want it to do, with the exception that it includes work planes in the extents if they are left visible. The finished version of the rule will be in our template files. I just want to get rid of this one final flaw before I release it to general use in my company.
Hi jtylerbc,
Here's an example that turns off and on any work feature that is on to start with. This works by adding the work feature names to an array list as they are turned off, and then using that list to turn them back on after the measurement is taken.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
oDoc = ThisDoc.Document
Dim MyArrayList As New ArrayList
'toggle work plane visibility off
For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes
If oWorkPlane.Visible = True Then
oWorkPlane.Visible = False
'add workplane to the array list
MyArrayList.add(oWorkPlane.name)
End If
Next
'toggle work axes visibility off
For Each oWorkAxis In oDoc.ComponentDefinition.WorkAxes
If oWorkAxis.Visible = True Then
oWorkAxis.Visible = False
'add workplane to the array list
MyArrayList.add(oWorkAxis.name)
End If
Next
'toggle work points visibility off
For Each oWorkPoint In oDoc.ComponentDefinition.WorkPoints
If oWorkPoint.Visible = True Then
oWorkPoint.Visible = False
'add workplane to the array list
MyArrayList.add(oWorkPoint.name)
End If
Next
'get measurements
Atrav_x = Measure.ExtentsLength
Atrav_y = Measure.ExtentsWidth
Atrav_z = Measure.ExtentsHeight
'show measurements
MessageBox.Show(Atrav_x & vblf & Atrav_y & vblf & Atrav_z, "ilogic")
'toggle work plane visibility back on
For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes
If MyArrayList.contains(oWorkPlane.Name) = True Then
oWorkPlane.Visible = True
End If
Next
'toggle work axes visibility back on
For Each oWorkAxis In oDoc.ComponentDefinition.WorkAxes
If MyArrayList.contains(oWorkAxis.Name) = True Then
oWorkAxis.Visible = True
End If
Next
'toggle work points visibility back on
For Each oWorkPoint In oDoc.ComponentDefinition.WorkPoints
If MyArrayList.contains(oWorkPoint.Name) = True Then
oWorkPoint.Visible = True
End If
Next
Both of you are "bad ****", you rule 🙂
I made simple changes in your codes like showned above
Thanks for all quick responses
And I'm Portuguese, not Spanish loooool
FG
oDoc = ThisDoc.Document Dim FGLista As New ArrayList 'desligar a visibilidade dos workplanes For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes If oWorkPlane.Visible = True Then oWorkPlane.Visible = False ' adicioná-los à lista FGLista.add(oWorkPlane.Name) End If Next 'desligar a visibilidade dos eixos For Each oWorkAxis In oDoc.ComponentDefinition.WorkAxes If oWorkAxis.Visible = True Then oWorkAxis.Visible = False ' adicioná-los à lista FGLista.add (oWorkAxis.Name) End If Next ' desligar a visibilidade de todos os pontos For Each oWorkPoint In oDoc.ComponentDefinition.WorkPoints If oWorkPoint.Visible = True Then oWorkPoint.Visible = False ' adicioná-los à lista FGLista.add(oWorkPoint.Name) End If Next 'sacar as medidas Atrav_x = Measure.ExtentsLength Atrav_y = Measure.ExtentsWidth Atrav_z = Measure.ExtentsHeight 'ligar a visibilidade dos workplanes For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes If FGLista.contains(oWorkPlane.Name) = True Then oWorkPlane.Visible = True End If Next 'ligar a visibilidade dos eixos For Each oWorkAxis In oDoc.ComponentDefinition.WorkAxes If FGLista.contains(oWorkAxis.Name) = True Then oWorkAxis.Visible = True End If Next 'ligar a visibilidade de todos os pontos For Each oWorkPoint In oDoc.ComponentDefinition.WorkPoints If FGLista.contains(oWorkPoint.Name) = True Then oWorkPoint.Visible = True End If Next
We have a plate template that just makes a 10x10x1 inch plate by default, to which we change the parameters. We only add sketches to make cutouts, etc but never change the original sketch geometry at all.
Curtis, that's fantastic. It resets the visibility so quickly I had to put in an "OK" box just to see the planes hide in my test model. Most of my users will never know what sort of majic is making their parts work.
A little testing and some integration with my current code, and I'll have fully automatic descriptions for all my plate models.
Would this code go in the part templates or the assembly template?
Curtis,
Just wanted to pop back in and share something one of my coworkers and I discovered.
We often have copied surface bodies to make adaptive notches in our plates (generally for an interface with another plate). We found in our testing that these surface bodies, if left visible, caused the same problem with measured extents that the work planes were causing. In his attempt to find a way to shut off the visibility of the surface bodies, he stumbled across something that not only works, but is an easier way to deal with the work features as well.
Rather than identifiying visible work features, turning them off, and storing them in an array to be reactivated later, this uses iLogic to turn off the Object Visibility (from the View tab), then turn it back on.
' To turn work feature visibility off before the measurement
oDoc.ObjectVisibility.AllWorkFeatures=False
' To turn visibility back on after the measurement
oDoc.ObjectVisibility.AllWorkFeatures=True
This seems to have the same effect on the extents measurement as your code, but is much shorter. Additionally, we're able to modify these lines to shut off anything listed in the Object Visibility dropdown, including Construction Surfaces, which resolves our copied surface issues.
True, but I believe the previous code would allow turning those features off and leaving them off, while the view function is a temporary thing and turns all planes baxck on, even the ones you may not want.