Message 1 of 3
How create line with block
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi
I want to create a line with blocks :
Function CreateLine(firstPoint, secondPoint)
Dim StartPoint(0 To 2), insPt(0 To 2) As Double
Dim MyBlock As AcadBlock
Dim blockName As String
Dim EndPoint(0 To 2) As Double
blockName = "masoud"
StartPoint(0) = firstPoint(0)
StartPoint(1) = firstPoint(1)
'StartPoint(2) = 0
EndPoint(0) = secondPoint(0)
EndPoint(1) = secondPoint(1)
'EndPoint(2) = 0
'With ThisDrawing.ModelSpace
'.AddLine StartPoint, EndPoint
'.Item(.Count - 1).Update
'End With
'Create a new block
Set MyBlock = ThisDrawing.Blocks.Add(insPt, blockName)
'ADD LINES DIRECT ON YOUR BLOCK
MyBlock.AddLine StartPoint, EndPoint
'Add the blockreference in model space
ThisDrawing.ModelSpace.InsertBlock insPt, blockName, 1, 1, 1, 0
End Function
but I got this error:
invalid procedure call or argument.
I want to create line with block as I find it with specific name. because user want to delete it.