Hi,
In a drawing I have made a handfull of blocks with the names block1, block2 etc. each with one attribute.
I have an Excel document and for each line I want to insert a block, based on the block name(column A), fill in the attribute info(column B), and place it based on column C.
Can it be achieved in LT through scripts or do I have to use LISP for such things?
Solved! Go to Solution.
Solved by sthompson1021. Go to Solution.
Can you explain exactly how you are running the commands from excel into Autocad. And post a copy of your command history (F2) from that process.
Attached is what I get, the left part of the drawing is what happens when I copy and paste directly from Excel into the command line. and on the right is the result of creating a script file from the Excel list, and then running the script.
Next to each group of 3 blocks (I only get 3) is a copy of the command history showing how it goes wrong, there is a slight difference in how AutoCAD treats a macro and a script when it comes to the x and y scales.
There is a chance that system variable differences are at play but I would need to see your command history to see what AutoCAD is doing during the macro/script.
_-INSERT space or linebreak as Enter
Blockname linebreak as enter
coordinates space or linebreak as Enter
1 for XYZ-scaling and space or linebreak as Enter
0 for rotation and space or linebreak as Enter
attval1 linebreak as Enter
attval2 linebreak as Enter
attval3 linebreak as Enter
See my quick AND DIRTY correction attached.
My sample: Copy the BLUE range and paste it to the command line.
This way it isn't a script, it is just like type in by hand.
As Script you have to edit the content because Scripts are using another INSERT command version.
Sebastian
I copied the excel output from the attached XLS
and clicked the command line in Cad and pressed Control-V
the attached CAD file is the output of my last test with the F2 results pasted in.
Thank you very much for your help.
regarding the SysVar any Ideas on which might be messing me up
Here is a spreadsheet that works. You almost had it on the last try but you should have left the first attribute where it was.
If you look at your command history that you show, the rotate angle "0" isn't used for the angle it shows up as an 'unknown' command.
That is because in your Excel file you actually have two spaces in between the numbers in column D, it's only a small thing but difficult to trace unless you read the command history and see where it is going wrong.
Sri,
I want Insert the block, how to write in script in excel
Please suggest
siva
Can't find what you're looking for? Ask the community or share your knowledge.