Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I would like to add a chamfer note to my drawing with iLogic. Here is how I'd place it in the UI:
Here is my code:
Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oSheet As Sheet = oDoc.ActiveSheet 'Sheet defined from document for access to chamfer notes. Dim oView As DrawingView = oSheet.DrawingViews.Item(1)'View defined to get the name as view defined by ThisDrawing only accepts itemByName Dim viewname As String = oView.Name 'get view name Dim MainSheet = ThisDrawing.ActiveSheet 'Sheet defined from drawing for use of GetIntents. Dim VIEW1 = MainSheet.DrawingViews.ItemByName(viewname) 'View defined for GetIntents. Dim ChamferFaceIntent As GeometryIntent = VIEW1.GetIntent("ChamferFace", nearPoint := VIEW1.SheetPoint(0.5, 0))' Get the geometry intents Dim ChamferFace_PosX = VIEW1.GetIntent("ChamferFace", PointIntentEnum.kMidPointIntent).PointOnSheet.X * 10 - 20 'x10 to convert to mm, -20 to move it slightly way from the drawing Dim ChamferFace_PosY = VIEW1.GetIntent("ChamferFace", PointIntentEnum.kMidPointIntent).PointOnSheet.Y * 10 - 20 Dim InternalFaceIntent As GeometryIntent = VIEW1.GetIntent("InternalFace", nearPoint := VIEW1.SheetPoint(0.5, 0)) 'Get Intent for internal diameter faces. Dim oChamferNote As ChamferNote = oSheet.DrawingNotes.ChamferNotes.Add(ThisDrawing.Geometry.Point2d(ChamferFace_PosX, ChamferFace_PosY), ChamferFaceIntent, InternalFaceIntent)' Add the chamfer note.
And my error:
I'm having trouble with co-ordinates. Where have I gone wrong?
I have attached the files.
Thanks,
Harvey
Solved! Go to Solution.