I am looking for a way to load linetypes (perhaps from acad.lin). The
-linetype command brings up a dialogue box, and I wonder if anyone out
there has found a way to load linetypes transparantly in autolisp.
Thanks in advance for reading this.
Dave
If you are using R14, the:
linetype
command is supposed to bring up a dialog box, and the:
-linetype
command is suppose to run without a dialog box. Are you saying that
typing "-linetype" at the "Command:" prompt brings up a dialog box for
you?
jrf
Dave
Regards,
Ken Krupa
David Millar <d...@ica.net> wrote in article <35B3026B...@ica.net>...
I know about tblsearch; however, the linetype that I want to load is not in the
table. We know that it exists in 'acad.lin'. Can we load linetype 'hidden2'
from 'acad.lin' in autolisp, if the linetype is not in the table?
Thanks
Dave
That's just what this function does. It uses tblsearch to determine if the
desired linetype is already in the drawing, because if it is you don't want
to keep reloading it. If it's not already in the drawing, then it uses the
linetype command to load it, from the default location of "acad.lin". The
second call of tblsearch is just to confirm that the linetype was indeed
successfully loaded (or give an error message if not). As long as you have
this function defined, your routine would then simply call
(my_linetype_load "hidden2").
Hope that helps.
Ken Krupa
David Millar <d...@ica.net> wrote in article <35B3FDE2...@ica.net>...
Steve Johnson
cad nauseam - http://ourworld.compuserve.com/homepages/SteveJohnson/
CADLock - http://www.cadlock.com/
Re-read, I must do. p.s. since I've started using Vital Lisp, my learning curve has
been assisted greatly.
Dave
;;; A_LTYPE
(defun c:ldlines ()
(prompt "\nLoading custom linetypes...")
(ltype:ld_type)
(princ)
) ;_ end of defun
(vl-acad-defun 'ltype:ld_type)
(defun ltype:ld_type (/ lts-sdsk)
(setvar "filedia" 0)
(setq
lts-sdsk
(list
"centerf" "centerf2" "boundary" "contour"
"phantom2" "invisible" "hidden" "hidden2"
"center2" "dashed2" "dashed"
) ;_ end of list
;_ end of list
) ;_ end of setq
(foreach n lts-sdsk
(if (tblsearch "LTYPE" n)
nil
(if (findfile "sdsk.lin")
(command "_.linetype" "_l" n "sdsk.lin" "")
) ;_ end of if
) ;_ end of if
) ;_ end of foreach
(setvar "filedia" 1)
(princ)
) ;_ end of defun
;;initialization
(c:ldlines)
David Millar wrote in message <35B3026B...@ica.net>...
In other words, (defun ...) defines the function in and (vl-acad-defun ...)
makes it available in both environments.
Of course, (defun ...) is explained in both the AutoCAD and Visual LISP
documentation, and (vl-acad-defun ...) is explained in the Visual LISP
documentation.
jrf
In article <35c88316....@adesknews.autodesk.com>, Dave Lewis wrote:
> Why the vl-acad-defun and the regular defun?
> What's the difference?