Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
The Below code creates a General Dimension between to defined faces,
I have tried but with no luck to change this to work with a Ordinate Set Dimension.
With "_End Stud:1" being the origin.
I tried to use the link below to get it work.
It seems to be a issue with defining a (DrawingCurveSegment)
Dim Doc As DrawingDocument
Doc = ThisDoc.Document
Dim oSheet As Sheet
oSheet = Doc.ActiveSheet
Dim oView As DrawingView
oView = oSheet.DrawingViews(1)
Dim oAsmDoc As AssemblyDocument
oAsmDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
Dim oCompDef As AssemblyComponentDefinition
oCompDef = oAsmDoc.ComponentDefinition
Dim FPColl As ObjectCollection
Dim OverallColl As ObjectCollection
Dim oText As Point2d
Dim S1 = oCompDef.Occurrences.ItemByName("_End Stud:1")
Dim S2 = oCompDef.Occurrences.ItemByName("_Left Stud:1")
FPColl = ThisServer.TransientObjects.CreateObjectCollection
OverallColl = ThisServer.TransientObjects.CreateObjectCollection
Dim namedEntities = iLogicVb.Automation.GetNamedEntities(S1.Definition.Document)
Dim S1Face As Face = namedEntities.FindEntity("Face1")
Call S1.CreateGeometryProxy(S1Face, oSketchProxy)
Dim S1Curve = oView.DrawingCurves(oSketchProxy)
oIntent = oSheet.CreateGeometryIntent(S1Curve.Item(1))
Call OverallColl.Add(oIntent)
namedEntities = iLogicVb.Automation.GetNamedEntities(S2.Definition.Document)
Dim S2Face As Face = namedEntities.FindEntity("Face1")
Call S2.CreateGeometryProxy(S2Face, oSketchProxy)
Dim S2Curve = oView.DrawingCurves(oSketchProxy)
oIntent = oSheet.CreateGeometryIntent(S2Curve.Item(1))
Call OverallColl.Add(oIntent)
oText = ThisServer.TransientGeometry.CreatePoint2d(oView.Center.X - oView.Width / 2, oView.Center.Y - oView.Height / 2)
oText.Y = oText.Y - 1
Call oSheet.DrawingDimensions.GeneralDimensions.AddLinear(oText, OverallColl.Item(1), OverallColl.Item(2)).CenterText
any help will be appreciated
Solved! Go to Solution.