block inserting twice

block inserting twice

Anonymous
Not applicable
264 Views
1 Reply
Message 1 of 2

block inserting twice

Anonymous
Not applicable
Hello all,

Newbie here trying to do some VBA.

I've got code that does what I want, but it inserts the block twice???? Any suggestions on how to modify the code to only insert the block once at the given location?


Dim blockRefObj As AcadBlockReference
Dim insertionPnt(0 To 2) As Double
insertionPnt(0) = 567.59: insertionPnt(1) = 929.73: insertionPnt(2) = 0#
Set blockRefObj = ThisDrawing.PaperSpace.InsertBlock(insertionPnt, "C:\Oilfield ACAD-config\Blocks\VERT-COORDS.dwg", 1#, 1#, 1#, 0)


Thanks
0 Likes
265 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Set BlockRef = ThisDrawing.Blocks("*MODEL_SPACE").InsertBlock(point, Path, 0.1764, 0.1764, 0.1764, 0#)

where
point is ur insertion point
Path is ur path
0.1764 is x , y ,z scale
0 Likes