VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Inserting stored block into the active drawing

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
522 Views, 2 Replies

Inserting stored block into the active drawing

I want to insert a stored block into a drawing (model space).  Below is the code I'm using and I get 

 

Runtime Error '5': Invalid procedure call or argument.

 

Any suggestions would be much appreciated.

Thanks

 

 

Sub Dummy()
Dim COESTD_obj As AcadBlockReference, InsPtStd(0 To 2) As Long, COESTD As String


COESTD = "C:\Jim\HYDRO\CAD_Dwgs\ZBlocks\ZZ_COE_STDS.dwg"
InsPtStd(0) = 0#: InsPtStd(1) = 0#: InsPtStd(2) = 0# 'Set insertion point as 0,0,0
Set COESTD_obj = ThisDrawing.ModelSpace.InsertBlock(InsPtStd, COESTD, 1#, 1#, 1#, 0#)
End Sub

2 REPLIES 2
Message 2 of 3
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

I guess that declaration is not ok for AutoCAD:

InsPtStd(0 To 2) As Long ==> should be Double

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 3
Anonymous
in reply to: Alfred.NESWADBA

Alfred,

     You're absolutely right.  You made my day.

Thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost