G_L Parameter

G_L Parameter

ABHUT_9090
Enthusiast Enthusiast
4,292 Views
26 Replies
Message 1 of 27

G_L Parameter

ABHUT_9090
Enthusiast
Enthusiast

Hii,

 

Is it possible that G_L parameter will show the final value of max length of the part after finishing modeling and it won't affect the the whatever tool we use to make that part, at the end final max length of the part i want in this G_L parameter.

 

Thanks,

 

0 Likes
Accepted solutions (1)
4,293 Views
26 Replies
Replies (26)
Message 2 of 27

b.mccarthy
Collaborator
Collaborator

Can you post an example, please?

0 Likes
Message 3 of 27

CGBenner
Community Manager
Community Manager

@ABHUT_9090 

 

Hi, it's been a while since I used Frame Generator in practice, but I seem to remember that the final cut length after trimming and notching is stored in B_L.  Maybe take a look into that?

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!



Chris Benner

Community Manager - NAMER / D&M


0 Likes
Message 4 of 27

ABHUT_9090
Enthusiast
Enthusiast

Hii @CGBenner ,

 

Inventor system only creates parameter G_L for length while publishing ipart to content center library using custom shape authoring tool. So in the parameter dialog there is no such parameter as ''B_L''. And G_L parameter is good and give latest length until you use tool that are in frame tab but when you perform external task like extrude or cut etc. on that part then G_L parameter won't take into consideration of final length after that operation. Why is that?

 

Thanks,

 

0 Likes
Message 5 of 27

b.mccarthy
Collaborator
Collaborator

You can still create the B_L and G_L parameters and use them if you wish. You will have to modify the Bill Of Materials output in your document settings to populate the BOM correctly.

0 Likes
Message 6 of 27

CGBenner
Community Manager
Community Manager

@ABHUT_9090 

 

Please describe your workflow and how you are using these parts.  Are you placing them manually, as Standard (or as Custom), and then modifying them?

If I place an instance of an Angle, for example, and specify a length of 12".  The part is generated with G_L in the Custom iProperties, and B_L in the Parameters.  So, I think I would need to know how you are using these parts, and then I can try some things and offer more advice.

 

These parameters generally update well when used with the Frame Generator tools.  Those parameters are created during the process of authoring the iPart for use with frame Generator.

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!



Chris Benner

Community Manager - NAMER / D&M


Message 7 of 27

ABHUT_9090
Enthusiast
Enthusiast

Hello,

 

 I found the solution for sheet metal part where we need two dimensions length and width , so the code i found is this " 

'Sets LengthExtents and WidthExtents Parameters to the Sheet Metal Extents
Length_Extents = SheetMetal.FlatExtentsLength
Width_Extents = SheetMetal.FlatExtentsWidth 

with this code whatever task (cut, flange, hem ....anything) i perform on the sheet metal part at the end it will show me final length and width of that flat pattern part stored in that parameter, so I want to do the same thing with standard solid part but in solid part i only want length dimension updated and stored in some parameter at the end of modeling. Width and Height is fixed here just length is variable and i am taking it from my custom content center. so what could be the possible solution here ?

 

Thank you,

0 Likes
Message 8 of 27

pcrawley
Advisor
Advisor

Regarding some of the previous replies:

 

  • G_L is the final cut length - providing you use frame generator tools to cut/extend frame members.  G_L is created by Frame Generator when the part is created, and it is linked to a reference dimension from a sketch between start and end workplanes.  The workplanes are "owned" by Frame Generator and are moved by Frame Generator commands - so safest not to mess with them! 
  • B_L is the un-cut length - the length originally placed.  I think of it as 'blank length'.

Neither parameter take into account extra modelling features - so if you manually extrude/cut a frame member, G_L will not update.  If you examine a frame member and look at how it is built, moving the start and end planes does update G_L - but be aware that any future Frame Generator commands will take control of those planes and move them.  

 

Your last post suggests a different scenario altogether:  There is a thing called a "bounding box" which you can see when using "Derive" - but is otherwise only available programmatically:

1.jpg

You can find the length of the bounding box, but it gets complicated quickly, especially if you use skeletal modelling and your part does not lie neatly on an origin plane.

 

If you can explain what you are trying to achieve, and describe how you make the parts that you need to measure (top-down, bottom-up etc), you may find some people here who have suggestions on how you can achieve your goal.

Peter
Message 9 of 27

gcoombridge
Advisor
Advisor

@pcrawley there was a new API method in 2020 I think called OrientedMinimumRangeBox which accounts for the object being off plane (this doesn't really matter in FG parts because the part is aligned to the origin and placed in the assembly). Very useful for other things though... 

 

@ABHUT_9090 here is some code to give you the range box length of the parts and create/add it to a parameter called 'Length'. Note it will overwrite any other user parameter called length and is in metric. Run from the part document. You could use it to overwrite the G_L value.

Dim oDoc As PartDocument = ThisDoc.Document
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition

Dim oSolid As SurfaceBody
Dim oUserParam As UserParameter
Dim oLength As Double

If oDef.SurfaceBodies.Count > 0 Then

oSolid = oDef.SurfaceBodies.Item(1)
oLength = Round(MaxOfMany(oSolid.OrientedMinimumRangeBox.DirectionOne.Length, oSolid.OrientedMinimumRangeBox.DirectionTwo.Length, oSolid.OrientedMinimumRangeBox.DirectionThree.Length), 1)

Try 
	t = Parameter("Length")
	Parameter.Value("Length") = oLength * 10
Catch ' Create param	
	oDef.Parameters.UserParameters.AddByValue("Length", oLength, kmillimeterlengthunits)
End Try

End If

This rule will fall over if the frame section height is longer that the length. For example if you had a very stubby leg on a support frame. It will read the longest edge of the bounding box as the length

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
Message 10 of 27

b.mccarthy
Collaborator
Collaborator

@ABHUT_9090 

 

All excellent responses, but having an example to look at could help solve your dilemma...

Message 11 of 27

ABHUT_9090
Enthusiast
Enthusiast

Hello,

I am giving you example now, i took this part from content center providing length=60 in. you can see the parameter and iproperties dialog box in this screenshots.Capture00.PNG

 

Capture01.PNG

 Now i add cut extrude to this part so my final length is 55.00 in. you can see in the next two screenshot .Capture02.PNGCapture03.PNG

Now the problem is G_L parameter doesn't change ,it shows the same value you can see that in above screenshot. so is there any way to store this final length in some parameter automatic because i am dealing with iparts or if possible that G_L shows this final length?

 

Thank you,

0 Likes
Message 12 of 27

pcrawley
Advisor
Advisor

G_L is a parameter for Frame Generator to play with - it does not update if you make manual edits.

 

If you use Frame Generator tools to cut frame members like this, then G_L does exactly what you are asking for.

 

From an earlier reply:

 

  • G_L is the final cut length - providing you use frame generator tools to cut/extend frame members.  G_L is created by Frame Generator when the part is created, and it is linked to a reference dimension on a sketch between start and end workplanes.  The workplanes are "owned" by Frame Generator and are moved by Frame Generator commands - so safest not to mess with them! 
Peter
0 Likes
Message 13 of 27

gcoombridge
Advisor
Advisor

Another option here is to use a workplane in the frame sketch to trim the frame. This is an end treatment and so will be included in the calculation of the G_L parameter. It does of course depend on whether you are using frame sketches or simply opening the frame members from content center directly.

 

Screenshot of frame at full length:

image.png

Then the trim operation using frame sketch part workplane (replacing your extrusion):

image.png

image.png

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes
Message 14 of 27

b.mccarthy
Collaborator
Collaborator

You probably already know this...

 

The G_L parameter in Content Center (CC) parts is calculated by the distance between the Start and End planes of the part. When the CC part is placed into an assembly, it is generated using the New Body Between solution. The length you specify defines the B_L parameter, which sets the initial offset of these 2 planes. The Driven Length sketch is then generated using the 2 planes. The driven (or reference) parameter of this sketch  (100.000 in the part below) is what feeds the G_L parameter:

 

2021-12-16 425.jpg

 

Changing the B_L value updates the G_L parameter. As long as the Start/End plane locations are respected, the G_L value will update correctly.

 

In the context of an assembly, where CC components are typically used, these values will update automatically, as long as the part is set to Adaptive and the Start/End planes are used when constraining to the other members. Is your component part of an assembly, FG or otherwise? If your modifications are extreme, there are still ways to get the G_L value to report correctly.

 

Can you post the actual part (or even better, a simple assembly with the part?

 

@CGBenner asked you to explain your workflow, which can be extremely helpful.

 

HTH

0 Likes
Message 15 of 27

gcoombridge
Advisor
Advisor

@b.mccarthy you can quickly generate one yourself but creating a frame member and cutting it short with an independent extrusion. Why that is part of the workflow is a better question I suppose...

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes
Message 16 of 27

b.mccarthy
Collaborator
Collaborator

@gcoombridge There are a number of approaches to get this done, and using FG is only one of them.

 

@ABHUT_9090 Can you please describe your workflow?

 

 

0 Likes
Message 17 of 27

gcoombridge
Advisor
Advisor

@b.mccarthy I would have thought 2: 

  1. Create a frame generator member in context in an assembly using a frame sketch or point to point selection.
  2. Create a frame member through a Open from Content Center command or the favourites tab.

Either way the result is the same. A G_L parameter is created, exported to a custom iprop and assigned to the BOM length). If you further shorten the member with standard modelling operations the G_L value will no longer reflect the true length of the part.

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
Message 18 of 27

b.mccarthy
Collaborator
Collaborator

@gcoombridge 

 

3. Place a CC part in an existing assembly, and constrain using the Start/End planes

 

I am not disagreeing with you. Yes, the G_L association gets broken if you are not careful when doing secondary modifications. Wherever possible, we should attempt to use a workflow where this does not happen. But when it does, you can still use the G_L parameter to correctly feed a BOM. It involves a number of steps, but it works.

Message 19 of 27

pcrawley
Advisor
Advisor

Where the workflow breaks G_L, you could use the code posted by @gcoombridge to fix it (see "OrientedMinimumRangeBox" entry in this thread - how did I miss that - thank you!!). 

 

Attached is a part template which triggers the code on any geometric change, and uses G_L as the "Base Unit".  Any part created using this template now looks just like other structural shapes or frame generated parts when you see it in a cut list/part list.

 

Thanks for starting this post @ABHUT_9090 - I've learnt heaps!

Peter
Message 20 of 27

ABHUT_9090
Enthusiast
Enthusiast

Hi @pcrawley 

 

I can not open your file because i am using Inventor pro 2020. But i tried to run the above code and it shows me error like this "Capture04.PNG

 

So what does that mean?

 

Thanks,

 

 

0 Likes