Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I want to pick a point on a drawing, and draw some text at that point. The text is in a textbox on the form. I get the error message
"Calling method SetObjectId of interface IAcadBaseObject failed"
Private Sub CommandButton1_Click()
Dim textObj As AcadText
Dim textString As String
Dim insertionPoint(0 To 2) As Double
Dim height As Double
Dim returnPnt As Variant
UserForm6.Hide
textString = Trim(TextBox1)
' Return a point using a prompt
returnPnt = ThisDrawing.Utility.GetPoint(, "Pick a point: ")
insertionPoint(0) = returnPnt(0): insertionPoint(1) = returnPnt(1): insertionPoint(2) = returnPnt(2)
UserForm6.Show
height = 0.3
'CODE FAILS HERE
Set textObj = ThisDrawing.ModelSpace.AddText(textString,insertionPoint,height)
End Sub
Solved! Go to Solution.