Message 1 of 26
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Every one
Is it Possible to import form Excel layers to Autocad 2021
without using scripts or lisps ?
Solved! Go to Solution.
Hello Every one
Is it Possible to import form Excel layers to Autocad 2021
without using scripts or lisps ?
Solved! Go to Solution.
There has been no new feature added to 2021 to accomplish such a task to my knowledge. Is there a particular reason asl script or lisp is not desirable?
Christopher T. Cowgill, P.E.
AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2024 on Windows 10
Please select the Accept as Solution button if my post solves your issue or answers your question.
If you want to create the layer names in AutoCAD from a list in excel, you can try this, but you have to check the properties of the layers in AutoCAD afterwards.
First make the list of layers from excel with each layer separated by a comma(,) like: layer1,layer2,layer3,etc. Then use the command “-Layer”, select “New”, copy paste the list of layers in command line.
There are lot of ways to make a list from excel, you can try Concatenate or try Transpose option and then notepad.
Thanks a lot Chris and Janu for replying
I would like to use concatenate formula in excel but how can I add layer description and Line type
I dont really understand the function of this formula i need to how to made this script
The following shows how you can use the Excel concatenate command to create layers with a specified line weight and true color (amount of red, green, blue) from Excel data.
Char(34) is used to create quote marks when needed in the vlisp command statement to distinguish them from quotes needed by the concatenate function to identify a text string. I found it tricky to find a way to terminate the layer function but found that two char(34)'s did the trick.
Here is the contents of cell G2.
=CONCATENATE("(command ",CHAR(34),"-layer",CHAR(34)," ",CHAR(34),"m",CHAR(34)," ",CHAR(34),A2,CHAR(34)," ",CHAR(34),"LW",CHAR(34)," ",CHAR(34),B2,CHAR(34)," ",CHAR(34),CHAR(34)," ",CHAR(34),"c",CHAR(34)," ",CHAR(34),"t",CHAR(34)," ", CHAR(34),C2,",",D2,",",E2,CHAR(34)," ",CHAR(34),CHAR(34)," ",CHAR(34),CHAR(34),")")
It can be filled-down for the other layers. Simply copy the content of cells G2 to G6 and paste into the command prompt of AutoCAD or use Notepad to create a script (.scr) file.
The statement is a little unwieldy but works! There may be some simplification possible.
An alternative approach would be to create an Excel/VBA macro to create a script file.
Thanks a lot for replying
I need to add Layer description to this formula in excel how can I do it ?
Cjeck out the prompts you see when you give the -layer command. You want to duplicate those with the concatenate command. Use CHAR(34) to create " marks where AtuoCAD needs them. Use " " (quote space quote) to place a space between parameters.
The following will create a layer and give it a description.
The contents of cell C2 is:
=CONCATENATE("(command ",CHAR(34),"-layer",CHAR(34)," ",CHAR(34),"m",CHAR(34)," ",CHAR(34),A2,CHAR(34)," ",CHAR(34),"D",CHAR(34)," ",CHAR(34),B2,CHAR(34)," ",CHAR(34),A2,CHAR(34)," ",CHAR(34),CHAR(34)," ",CHAR(34),CHAR(34)," ",CHAR(34),CHAR(34),")")
Note that the "D" is used to pick the descriptor option and that:
," ",CHAR(34),CHAR(34)
is repeated 3 times at the end. This is to produce the 3 "Enters" needed to terminate the command.
Copying cells C2 to C6 the clipboard and then pasting into Autocad will generate this result:
Can you please help me. I have attached my spreadsheet. I would like to import the red columns into AutoCAD 2021. Can you insert the Autocad formula into the column to the right and upload it thanks. I really appreciate it.
Hi, can someone please check my formula? I cannot get the linetype, lineweight, and description into the formula. Can you help provide the formula?
kindly
Rather than specify to use a default value for a layer parameter with a double quote (CHAR(34), CHAR(3)) explicitly state the value (e.g., the layer name).
For example, change char(34),char(34) to char(34),A2,char(34)
Hi @yoav-d
I don't understand. Your dialog is on tab "Index color" and you can use index colors (only) on this tab,
what is your problem?
If you like to use the dialog while in Script, you have to use Lisp:
_.-LAYER
_new
123
_color
(acad_colordlg 7 nil)
123
_circle
2000,800
50
Sebastian
Sorry for not being clear.
I was asking about the relevant path to write in an xlsx file.
The definition for a new color in a new layer command, according to the command bar, are only "Truecolor" and "COlorbook", but no index color:
The examples here show only "t" for truecolor.
I'm still quite new to AutoCAD and not familiar enough with lisps, so I don't understand your example and whether it is relevant to my issue.
Thanks @cadffm ,
=CONCATENATE("(command ";CHAR(34);"-layer";CHAR(34);" ";CHAR(34);"m";CHAR(34);" ";CHAR(34);B34;CHAR(34);" ";CHAR(34);"LW";CHAR(34);" ";CHAR(34);I34;CHAR(34);" ";CHAR(34);CHAR(34);" ";CHAR(34);"c";CHAR(34);" ";CHAR(34);"t";CHAR(34);" ";CHAR(34);G34;CHAR(34);" ";CHAR(34);CHAR(34);" ";CHAR(34);"D";CHAR(34);" ";CHAR(34);L34;CHAR(34);" ";CHAR(34);CHAR(34);" ";CHAR(34);CHAR(34);" ";CHAR(34);CHAR(34);")")
This formula filled all empty descriprions in other layers. How to fill only one descriprion?
Here's an updated version of the Excel file that enables the creation of layers that allows the specification of:
layer name
true color layer color
line type
line weight
transparency
unique description for each layer
Just copy and paste the contents of column I into the AutoCAD command prompt.
Yes it wotks. Thank you.😁
Line type continuous only working, is that possible to change center or dashed Linetype?
Thanks.
@dseshanZQS9M wrote:
Line type continuous only working, is that possible to change center or dashed Linetype?
Thanks.
what do you currently have in your excel file?
Are center or dashed linetypes already defined in the drawing you are trying to use?
Christopher T. Cowgill, P.E.
AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2024 on Windows 10
Please select the Accept as Solution button if my post solves your issue or answers your question.