Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using Measure function within iPart.

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
Anonymous
913 Views, 15 Replies

Using Measure function within iPart.

Good day,

I am busy setting up a simplified bolt & nut iPart (the assembly in IV is too cumbersome and heavy and fiddly).  Anyone ever used the Measure function in an iPart to set a specific parameter, in this case to set the griplength which will then drive the bolt length....?  If you have, how would one go about it, please?

 

Regards

 

Kobus

15 REPLIES 15
Message 2 of 16
LukeDavenport
in reply to: Anonymous

Hi Kobus,

I would make the job easier by just (manually) creating a sketch with the normal Inventor tools, with a dimension (a reference dimension if necessary) for the grip length, the parameter for which you can refer to in another parameter like the bolt length. This is normal practice for Inventor parametric part design.

Hope this helps,

Luke

Message 3 of 16
Anonymous
in reply to: LukeDavenport

Hi Luke,

I appreciate your answer thanks, however I want to use this in an assembly where I will have parts being bolted together and I do not want to create sketches to drive my grip length.  First issue will be to either create a new part just for the sketch and parameter, or then the question would be in which part to have the sketch reside?

 

I am trying to make this as simple as possible so one will have a existing set of holes in the 2 or 3 parts, place the iPart of the bolt/nut/washer combo, select 2 surfaces (Measure function) which will determine the grip length and voila, the bolt part is inserted.  The only step thereafter would be to constrain it and the insert will work well.

 

I am pretty sure somebody has done this already....my iPart / iLogic capabilities are just lacking...

Regards

 

Kobus

Message 4 of 16
bradeneuropeArthur
in reply to: Anonymous

Hi,

 

For my understanding:

you need a (Part) ipart  that looks like a bolt with nuts and washer, right.

Only the grip length is a parameter that needs to be filled in and that is all, and is first measured in the assembly file?

Of course the bolt diameter is a parameter fot the I part.

 

Regards

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Message 5 of 16
Anonymous
in reply to: bradeneuropeArthur

Hi,

Yes you have it to a tee.  The actual bolt size I will select from a dropdown list which is part of my table.  If I see what the griplength is during this process I can select the bolt length from the dropdown.  Maybe once I have this working, I can use the measured griplength in a formula to calculate the bolt length to use but for now I will be happy with just measuring the length during the process.

 

The "Bolted Connection" that comes with IV is just too cumbersome and when we create the assemblies with these bolt assemblies in them, more often than not we experience problems when opening it on another user's pc.  Granted most of these issues are user errors....its also a time thing.  It does make the assembly react slower as well, especially when we start having big assemblies, which happens most of the time.

 

Regards

 

Kobus

Message 6 of 16
bradeneuropeArthur
in reply to: Anonymous

Hi,

 

One suggestion from my side:

Why don't you use a excel driven part instead.

Within excel you can create formulas easily to select a grip length within a range.

I use it often and it is much easier to define than with I-logic of I-parts...

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Message 7 of 16

@Anonymous,

 

For more understanding, can you please demonstrate the process with non confidential sample files ?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 8 of 16
Anonymous
in reply to: chandra.shekar.g

See attached file.  Simply two plates being bolted together.  The bolts are included and are iParts where you can select the length and specify the grip length manually.  I want to replace the grip length manual entry with a prompt using the measure function to get the length between the 2 outer edges of the plates.

 

Regards

 

Kobus

Message 9 of 16
Anonymous
in reply to: chandra.shekar.g

See attached file.  Simply two plates being bolted together.  The bolts are included and are iParts where you can select the length and specify the grip length manually.  I want to replace the grip length manual entry with a prompt using the measure function to get the length between the 2 outer edges of the plates.

 

Regards

 

Kobus

Message 10 of 16
Anonymous
in reply to: chandra.shekar.g

Good morning,

I have attached files as requested.

 

Regards

 

Kobus

Message 11 of 16
chandra.shekar.g
in reply to: Anonymous

@Anonymous,

 

You can use attributesets to detect 2 outer edges of plate. Same outer edges can be used to measure grip length through Inventor API.

 

Can you please mention the edges in a image which can be used to measure length?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 12 of 16
Anonymous
in reply to: chandra.shekar.g

Good day,

Sorry for only replying now.  Between running around on a project and trying to land new business its hectic.

 

So the idea would be when one bolts two plates of steel together, have a hole already where the bolting needs to be done....to then just select the start and end faces to specify the grip length.  This should happen as part of the exercise when placing the single part bolt and nut.

 

I attached all the part and assembly files of what we already have and use.  Also some screenshots of how it should work.  Quite happy to arrange a Teams screenshare if needed - I assume you sit in a different timezone than me but I am willing to look at either early morning or late evening for me.

 

Regards

 

Kobus

 

 

Message 13 of 16
JhoelForshav
in reply to: Anonymous

Hi @Anonymous ,

Can't you just measure the distance between start- and end face while selecting them for the placement and then set that value to the grip length parameter?

Something like this:

Dim oFace1 As FaceProxy = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select start face")
Dim oFace2 As FaceProxy = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select end face")
Dim oGripLength As Double = Math.Round(ThisApplication.MeasureTools.GetMinimumDistance(oFace1, oFace2), 5) *10
MsgBox(oGripLength & " mm")

 

Message 14 of 16
JhoelForshav
in reply to: Anonymous

Hi again @Anonymous ,

I took the time to write an iLogic rule for you. Hopefully it's what you're looking for 🙂

Dim oAsm As AssemblyDocument = ThisDoc.Document
Dim oFace1 As FaceProxy = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select start face")
Dim oFace2 As FaceProxy = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select end face")
Dim oHole As FaceProxy = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceCylindricalFilter, "Select Circular reference")

Dim FactoryFile As String = "C:\VaultWorkingFolder\Designs\Temp\Jhoel\BoltingAssy\M12 Bolt Nut Washer.ipt" 'Full file path to iPart factory
Dim MemberFile As String = "C:\VaultWorkingFolder\Designs\Temp\Jhoel\BoltingAssy\TestMember1" & ".ipt" 'Full file path to iPart member

Dim oGripLength As Double = Math.Round(ThisApplication.MeasureTools.GetMinimumDistance(oFace1, oFace2), 5) *10
Dim oCustomArr(0) As String
oCustomArr(0) = oGripLength & " mm"

Dim oMember As ComponentOccurrence = oAsm.ComponentDefinition.Occurrences.AddCustomiPartMember(FactoryFile, _
ThisApplication.TransientGeometry.CreateMatrix(), MemberFile, ,oCustomArr)

Dim oZaxis As WorkAxisProxy
Call oMember.CreateGeometryProxy(oMember.Definition.WorkAxes.Item("Z Axis"), oZaxis)
Dim oInsPlane As WorkPlaneProxy
Call oMember.CreateGeometryProxy(oMember.Definition.WorkPlanes.Item("XY Plane"), oInsPlane)

oAsm.ComponentDefinition.Constraints.AddMateConstraint(oZaxis, oHole, 0, ,InferredTypeEnum.kInferredLine)
oAsm.ComponentDefinition.Constraints.AddMateConstraint(oFace1, oInsPlane, "2.5 mm")

If you run this rule from the main assembly you've attached previously you'll be asked to select start face, end face and hole.

The code will then place your bolt with desired grip length and constrain it in position 🙂

Message 15 of 16
Anonymous
in reply to: JhoelForshav

Thanks a million, if ever you're in South Africa, I owe you a beer and a steak.  We're going to put it all together, will keep you up to date.

Message 16 of 16
JhoelForshav
in reply to: Anonymous

@Anonymous 

Happy to help!😃

Good luck with your project!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report