Copy & Paste blocks from excel to command line

Copy & Paste blocks from excel to command line

Anonymous
Not applicable
1,311 Views
7 Replies
Message 1 of 8

Copy & Paste blocks from excel to command line

Anonymous
Not applicable

Hi All

I have been trying to copy & paste a block from an excel sheet when I paste into command line (-Insert Double socket 222,333) I get a box wanting a substitute block, but the block is already in the blocks file, pic attached any help would be greatly appreciated.

 

Chris 

0 Likes
Accepted solutions (1)
1,312 Views
7 Replies
Replies (7)
Message 2 of 8

Moshe-A
Mentor
Mentor

@Anonymous  hi,

 

please upload the dwg + excel files

 

moshe

 

 

0 Likes
Message 3 of 8

Anonymous
Not applicable

Hi

Please find drw attached the excel sheet only has this at the moment(-Insert test 222,333)   which I am pasting into autocad command line

 

Regards

 

0 Likes
Message 4 of 8

Moshe-A
Mentor
Mentor

@Anonymous  hi,

 

if you want to insert a block why don't you use the insert command?

the autolisp code you are pasting is incomplete and that's why it doesn't work.

 

moshe

 

0 Likes
Message 5 of 8

Anonymous
Not applicable

Hi 

I use pline all the time from a spreadsheet to plot lines so was hoping to do the same with a block for multiply insertions could you tell me what is missing from code

 

Thank you

 

0 Likes
Message 6 of 8

Moshe-A
Mentor
Mentor

this is a legal autolisp code line

 

(command "-insert" "test" "222,333" 1 1 0) 

 

 

 

0 Likes
Message 7 of 8

leeminardi
Mentor
Mentor
Accepted solution

You can use the Excel concatenate function to build a vlisp command to insert the cells.  I used char(34) to create the quotes around some of the parameters in the insert command.

You can copy the contents of column D off the spreadsheet into the command line of AutoCAD to add multiple instances of many blocks.

Cell D2 contains:

=CONCATENATE("(command ",CHAR(34),"-insert",CHAR(34)," ",CHAR(34),A2,CHAR(34)," ",CHAR(34),B2,",",C2,CHAR(34)," ",CHAR(34),CHAR(34)," ",CHAR(34),CHAR(34)," ",CHAR(34),CHAR(34),")")

Which yields a statement like the following:

(command "-insert" "Doors_ExtDbl_w-Glazing_Bars_1 - 1510x2110mm-10509454-Level 0" "1000,600" "" "" "")

 

image.png

lee.minardi
Message 8 of 8

Anonymous
Not applicable

Hi Thank you very much for your reply,but I still have the warning message,drives you crazy ? Picture attached

 

 

cTRLS9_0-1588057167186.png

 

0 Likes