Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been using attributes to dimension drawings for a while now. For the most part it works well enough, but I'm running into a problem using the same logic to create a chamfer note. For most dimension and note methods I have to pass GeometryIntent into the method. However, the ChamferNotes.Add Method requires a DrawingCurve be passed into the method. There are no examples to compare to my code. The closest I have found is the BendNotes.Add Method, which also requires a DrawingCurve. Something isn't working correctly. Any help would be appreciated.
My sub call:
AddChamferNote("B","CHAMFER_FACE","FLAT_FACE",5,5)
My procedure to easily create chamfer notes:
Sub AddChamferNote(View As String, Edge1 As String, Edge2 As String, Optional NoteLocationX As Double = 1, Optional NoteLocationY As Double = 1) ' Set a reference to the drawing document. ' This assumes a drawing document is active. Dim oDoc As DrawingDocument = ThisDoc.Document Dim oSheet As Sheet = oDoc.ActiveSheet Dim oView As DrawingView = ActiveSheet.View(View).View ' Ready code for creating of reference points Dim oTG As TransientGeometry = ThisApplication.TransientGeometry Dim oViewModelDoc As Document = oView.ReferencedFile.ReferencedDocument Dim aoEdge1 As Object oObjs = oViewModelDoc.AttributeManager.FindObjects(Edge1, "DIM", "1") aoEdge1 = oObjs.item(1) Dim aoDrawingCurve1 As DrawingCurve oDrawViewCurves1 = oView.DrawingCurves(aoEdge1) aoDrawingCurve1 = oDrawViewCurves1.item(1) Dim aoEdge2 As Object oObjs = oViewModelDoc.AttributeManager.FindObjects(Edge2, "DIM", "1") aoEdge2 = oObjs.item(1) Dim aoDrawingCurve2 As DrawingCurve oDrawViewCurves2 = oView.DrawingCurves(aoEdge2) aoDrawingCurve2 = oDrawViewCurves2.item(1) Dim oPosition As point2d = oTG.CreatePoint2d(NoteLocationX, NoteLocationY) Dim oChamferNote As ChamferNote oChamferNote = oSheet.DrawingNotes.ChamferNotes.Add(oPosition, oDrawViewCurve1, oDrawViewCurve2) oChamferNote.AttributeSets.Add("ilogic_Created") End Sub
Solved! Go to Solution.