- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi,
i have tried using the automated centerlines on inventor and it either does too much or too little for my use.
i have tried ilogic codes available on the forum but nothing has worked fully so far.
basically we have items on our library and we mostly use them to create assembly files and drawings.
i was thinking if i could make the axis of the individual parts visible on the drawing, this would somewhat visually work as a centreline. doing it manually works perfectly but it is more time consuming than using the centreline feature.
i have found a code that makes the required axis visible on a drawing but it only does it for one item.
is it possible to make it do it for all parts in the assembly?
Dim oDoc As DrawingDocument oDoc = ThisApplication.ActiveDocument Dim oView As DrawingView = ActiveSheet.View("FRONT VIEW").View Dim oAssyDoc As AssemblyDocument = ActiveSheet.View("FRONT VIEW").ModelDocument Dim oTG As TransientGeometry = ThisApplication.TransientGeometry Dim oPt As Point2d = oTG.CreatePoint2d Dim oOcc1 As ComponentOccurrence = oAssyDoc.ComponentDefinition.Occurrences.AllLeafOccurrences.Item(1) Dim oSheet As Sheet oSheet = oDoc.ActiveSheet Dim oDocDef1 As Document = oOcc1.Definition.Document Dim oWA1 As WorkAxis = oDocDef1.ComponentDefinition.WorkAxes.Item("X Axis") Dim oWAP1 As WorkAxisProxy ' For Each myAxis In oDocDef1.ComponentDefinition.WorkAxes ' If myAxis.Name = "InletRefAxis" Then oWA1 = myAxis ' Next oOcc1.CreateGeometryProxy(oWA1, oWAP1) Dim oCL1 As Centerline oCL1 = oSheet.Centerlines.AddByWorkFeature(oWAP1, oView)
Solved! Go to Solution.