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: 

Create parameter for projected loop

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
555 Views, 4 Replies

Create parameter for projected loop

Hi all,

 

I work within furniture manufacturing and end up using a non-modeled parts list which we all have to manually fill out. My aim is to transition it to a fully modeled parts list, so it's automatically filled out by modeled details.

One of the parts in the list is a worktop nosing. To create this we make a sketch perpendicular to the edge of the worktop and then use the sweep feature to loop it round the outer edge of the worktop. The problem here is that we approximate the total length by adding up the length and width of the worktop (adding a few hundred mm for a buffer) and manually enter it.

 

If I open up the loop sketch that the sweep feature creates, I can measure the loop line (although we still need to add a buffer). I want to add that measurement as a parameter and use it to define the Bill of Materials property.

 

Is this possible?

 

I have already posted this question but posted it in the wrong section/board. Please see link below:

https://forums.autodesk.com/t5/inventor-forum/create-parameter-for-projected-loop/m-p/10401089#M8315...

Labels (4)
4 REPLIES 4
Message 2 of 5
A.Acheson
in reply to: Anonymous

That error message doesn’t make sense to me either. You can try place a message box at the line you think the error occurs at. If the message box shows up keep trying until you get the error message. Then start debugging the line that has failed. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 3 of 5
WCrihfield
in reply to: Anonymous

The inspiration for the code on that other post looks like it came from one of the Sample VBA macro's posted in the online help section.  The thing is, when I attempt to look up the method used in that code 'GetTruePath()', which is where your having the problem, according to the error message text you posted there, I'm not finding it where it should have been, so I'm not sure if it still exists.  According to that code, that method should have been documented under the SweepFeatures object, but it's not listed there.  It is also not listed under the singular SweepFeature object.

 

Since that method seemed to be used to capture all the 'curves' within the Path of the SweepFeature, I would say you need to use alternative means to replace that line of code.  I would dig down into the SpeepFeature.Definition.Path.  Then loop through the 'Items' in that Path, which are PathEntity's.  Each PathEntity has both a Curve and a SketchEntity property which could be used to gather the needed data from in the loop below.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS :light_bulb:or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 5
nmunro
in reply to: WCrihfield

The GetTruePath() method is now hidden, indicating it has been depreciated at some point in time. There are probably other ways to do this but this method could still be accessed.

 

2021-06-18_13-38-51.png

        


https://c3mcad.com

Message 5 of 5
Curtis_Waguespack
in reply to: Anonymous

Hu @Anonymous 

 

We could do this with a named face and measure the edgeloop.

 

To name the face, just right click on it and choose "Assign Name"

 

Curtis_W_0-1624050513747.png

 

In the above example there are 2 loops in the face, so we just have the code look for the largest.

 

Something like this example.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oTopFace As Face
Dim oMeasureTools As MeasureTools = ThisApplication.MeasureTools
Dim oEdgeLoop As EdgeLoop

Dim oNamedEntities = iLogicVb.Automation.GetNamedEntities(oDoc) 
oTopFace = oNamedEntities.FindEntity("TopFace") 


'measure all loops (we expect the outer loop is the largest
'on the face)
For Each oEdgeLoop In oTopFace.EdgeLoops
	
	x = oMeasureTools.GetLoopLength(oEdgeLoop)
	Logger.Info(x)
	If x > oOuterLoop Then
		oOuterLoop = x
	End If
Next

Logger.Info("largest loop: " & oOuterLoop)
oOuterLoop = Round(oOuterLoop,3) 
Parameter("Outer_Loop") = oOuterLoop

 

 

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

Post to forums  

Autodesk Design & Make Report