TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: gswang on May 22, 2019, 10:02:08 AM

Title: How to copy a linetype to a new name, but not rename?
Post by: gswang on May 22, 2019, 10:02:08 AM
How to copy a linetype to a new name, but not rename?
That is to say, keep the original linetype name.

thank you very much.
Title: Re: How to copy a linetype to a new name, but not rename?
Post by: ronjonp on May 22, 2019, 10:33:37 AM
Is this a trick question?  :-D
Title: Re: How to copy a linetype to a new name, but not rename?
Post by: PKENEWELL on May 22, 2019, 12:55:58 PM
@ gswang

1) Search for "acad.lin" file in you support paths. You can type (findfile "acad.lin") at the AutoCAD  command line.
2) Navigate to the folder where "acad.lin" is found and open the file in Notepad.
3) Find the linetype you want to copy in the file, then copy (CTRL+C) the 2 lines in the text file.
4) Go to a blank line in the text file and Paste (CTRL+V) the copied lines.
5) After the "*" and the "," on the first line of text, change the name of the Linetype to what you want. NOTE: You can also adjust the look of the linetype in the rest of the text lines, but you will have to learn how to do it properly (search for "To Add a Simple Linetype to an LIN File" in AutoCAD Help).
6) Save the acad.lin file
7) in the drawing , you will have to LOAD the linetype; i.e. select the linetype for the layer, when the dialog comes up, select the "Load button", then find the new linetype name.

Here is a link for more info: https://allaboutcad.com/tutorial-create-a-custom-simple-linetype/ (https://allaboutcad.com/tutorial-create-a-custom-simple-linetype/)

PS: You can also use the "Make Linetype" tool in Express Tools if you have them loaded (command MKLTYPE)
Title: Re: How to copy a linetype to a new name, but not rename?
Post by: Dlanor on May 22, 2019, 01:59:19 PM
And if your using metric find acadiso.lin
Title: Re: How to copy a linetype to a new name, but not rename?
Post by: Marc'Antonio Alessi on May 23, 2019, 08:32:25 AM
if your linetype is in Acad*.lin
   Read the file until find your linetype ex:
   *CENTER,Center ____ _ ____ _ ____ _ ____ _ ____ _ ____
   A, 31.75, -6.35, 6.35, -6.35
   write the  modified info in a .lin file then:
   (command ".-linetype" "load" "*" file "")
else:   
   rename your linetype ex: CENTER to MyCENTER
   wblock on DWG an object with linetype MyCENTER
   rename your linetype MyCENTER to CENTER
   insert DWG with MyCENTER

else:   maybe with (vla-copyobjects dbxDoc ...)