Hi, How can I load a linetype in the active document using VLisp. For example, Hidden. Thanks
(setq *acad* (vlax-get-acad-object) *acad_doc* (vla-get-activedocument *acad*) *acad_lin* (vla-get-linetypes *acad_doc*) ) (vla-add *acad_lin* "hidden") Bill
Bill, From the help file (R2002) this won't work as expected..... Although you can create a linetype and add it to the Linetypes Collection object using this method, it will be created with the default properties only. Because you cannot edit properties of the Linetype object with this release of ActiveX Automation, use the Load method to load existing linetypes into your drawing. Now, if this has changed in the newer releases, then forget I said anything.... ;-)
The "default" is "continuous" which kinda defeats the purpose of a linetype named "hidden"...... ;-) So just changing the last line of code you provided to this will work, if it exists in the file. (vla-load *acad_lin* "hidden" "acad.lin")
Must've changed for 2005. Command: (vla-load *acad_lin* "hidden" "acad.lin") ; error: Automation Error. Duplicate record name Command: (vla-load *acad_lin* "hidden") Works fine and the line is "dashed" by default. Bill
Opps, I meant to say: (vla-add *acad_lin* "hidden") Works fine and the line is "dashed" by default. Bill
Must've changed for 2005. The first line's error means that the linetype is already loaded in the drawing, which means the second line (I know you meant add, not load) doesn't error and is "hidden by default" because it is already defined........ Make sure to purge the hidden linetype first, then try again ;-)