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:
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.
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
(Not an Autodesk Employee)
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.
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"
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.