How to dimension 3D Sketch in drawing

How to dimension 3D Sketch in drawing

aelqabbany
Advocate Advocate
866 Views
7 Replies
Message 1 of 8

How to dimension 3D Sketch in drawing

aelqabbany
Advocate
Advocate

Hi,

 

I have prepared a 3D sketch in a part document. I want to reference the individual lines within that 3D sketch to dimension them in a drawing.

 

I can include the 3Dsketch in my drawing views, but that just adds the lines as DrawingCurveSegments, without indicating which is which.

 

Is there any way to name the lines in my 3D sketch so that I could refer to them and dimension them in my drawing?

 

Thanks in advance

Sketch to 3D Model.png

 

0 Likes
Accepted solutions (4)
867 Views
7 Replies
Replies (7)
Message 2 of 8

WCrihfield
Mentor
Mentor
Accepted solution

Hi @aelqabbany.  Yes, I believe this is possible.  Much the same way that the NamedEntity system works, that allows you to right-click on Faces, Edges, & Vertices on your part model, and assign names to them, but just not with that same user interface tool.  Behind the scenes that tool assigns an AttributeSet & Attribute to the selected object.  That attribute has a very specific name, and is put in a very specifically named AttributeSet on that object, then the Attribute's Value is set to the name you specify.  Then to find that same object, you find that specific AttributeSet (by its name), which contains that specifically named Attribute, that has the Value you specified.  The object that the AttributeSet is attached to is the object you are looking for.

You will notice that the SketchLine3D object has a Property called AttributeSets.  That's where you can create a new, specifically named AttributeSet within, then a specifically named Attribute within that new AttributeSet, then set the name you want as the Attribute.Value.  Does all that make sense to you?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 8

aelqabbany
Advocate
Advocate

Thank you very much. That makes sense, though I'll probably need to play around with it to completely get it.

 

The next question is once I've identified the line, how would I get its geometric intent on the drawing?

0 Likes
Message 4 of 8

WCrihfield
Mentor
Mentor
Accepted solution

By the way, I know I have created and posted iLogic rules and VBA macros here on the forums before that you could use to assign names to stuff using the Pick method, but there are actually a couple Inventor Add-Ins out there for this task too, which are much better.  The one I would recommend though is the one that Brian Ekins created called 'Nifty Attributes'.  There is also one called Attribute Helper floating around out there, but I lost the link to that one.  I have also seen a fairly new one posted on the Autodesk App Store published by Autodesk called Attribute Manager, but it doesn't have any reviews yet, and I haven't tried it out myself yet.  It does mention working with sketch geometry though.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 8

WCrihfield
Mentor
Mentor
Accepted solution

The DrawingView object in your drawing, where that geometry is showing, has a Property called DrawingCurves.  You can supply the model object as the input variable to that property to get the drawing view objects that it represents as a DrawingCurvesEnumerator object, which you can work with on the drawing side.  In the reverse direction, you can also use the ModelGeometry property of a DrawingCurve to get the object(s) on the model side that it represents.  Then from the Sheet object, you can use the CreateGeometryIntent method to create the intents you may need for creating the dimensions.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 8

WCrihfield
Mentor
Mentor
Accepted solution

Side note:  I just remembered where the Attribute Helper add-on was found.  It is included in the SDK UserTools folder after you install the usertools.msi file found in the following location:

C:\Users\Public\Documents\Autodesk\Inventor 2022\SDK\

And it seems to be a slightly earlier version of the Nifty Attributes add-in, so it was likely developed (at least partially, or in cooperation with Autodesk) by the same person (Brian Ekins), but that Attribute Helper version has been included with the Inventor install for a number of years, after you optionally install that usertools.msi file.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 7 of 8

aelqabbany
Advocate
Advocate

Thank you very very much. I'll get started with this, and let you know if I get stuck anywhere.

0 Likes
Message 8 of 8

aelqabbany
Advocate
Advocate

Since I know the exact order in which the lines are placed in my 3D sketch, I used the following approach:

Dim DrawDoc As DrawingDocument = ThisApplication.ActiveDocument
	
Dim oSheet As Sheet = DrawDoc.ActiveSheet
	
Dim FrontView As DrawingView = oSheet.DrawingViews(1)
	
Dim oPart As PartDocument = FrontView.ReferencedDocumentDescriptor.ReferencedDocument
	
Dim o3DSketch As Sketch3D = oPart.ComponentDefinition.Sketches3D("AutoFab-SawEdges")
	
Dim oSketchDrawingCurve As DrawingCurve = FrontView.DrawingCurves(o3DSketch.SketchLines3D(1))(1)
	
Dim oIntent As GeometryIntent = oSheet.CreateGeometryIntent(oSketchDrawingCurve)
	
Dim oDimPoint As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(oSketchDrawingCurve.MidPoint.X, oSketchDrawingCurve.MidPoint.Y + 2)
	
Dim oDim As LinearGeneralDimension = oSheet.DrawingDimensions.GeneralDimensions.AddLinear(oDimPoint,oIntent)

 Thank you very much @WCrihfield !