If you set DYNMODE to 1, Grrr's code should popup the options on the screen.
I never realized I could just click on any of the blue text and be taken to a definition page for that word. Life just got easier, me thinks. I know...what was I thinking?
I beat you to the punch on that one RonJonp but thanks for the messageGlad you got it sorted .. FWIW here's a little constructive criticism. Happy coding! :)
A more universal selector for the LineTypeFile may be something like :My version:Code - Auto/Visual Lisp: [Select]
; Function: ALE_Layer_LoadLinetype
;
; Version 1.00 - 16/11/2006
;
; Arguments:
; VlaDoc: IAcadDocument: An AutoCAD drawing or IAxDbDocument: Interface
; LTpCol: LineType Collection
; LtpNam: Linetype name [STR]
;
; Return Values: [VLA-OBJECT] or nil if vla-load fails
;
; Example:
; (or *AcadApp* (setq *AcadApp* (vlax-get-Acad-Object) ))
; (or *AcAcDwg* (setq *AcAcDwg* (vla-get-ActiveDocument *AcadApp*)))
; (or *AcLnTps* (setq *AcLnTps* (vla-get-Linetypes *AcAcDwg*)))
;
; (ALE_Layer_LoadLinetype *AcAcDwg* *AcLnTps* "Divide")
;
(defun ALE_Layer_LoadLinetype (VlaDoc LTpCol LtpNam / VrtVal)
(cond
( (ALE_Utl_GetItem LTpCol LtpNam) )
( (vl-catch-all-error-p
(vl-catch-all-apply
'vla-load
(list
LTpCol
LtpNam
(cond
( (vl-catch-all-error-p (setq VrtVal (vl-catch-all-apply 'vla-getvariable (list VlaDoc "MEASUREINIT"))))
"acadiso.lin" ; load linetype from metric linetype file if VlaDoc is a IAxDbDocument: Interface
) ; because getvariable it is not a property of a ODbx Document
( (zerop (vlax-variant-value VrtVal));English or metric
"acad.lin" ; load linetype from english linetype file
)
( "acadiso.lin" ); load linetype from metric linetype file
)
)
)
)
;_i__ (alert (strcat "Asso message:\nTipolinea '" LtpNam "' non trovato in Acadxxx.lin"))
;|e|; (alert (strcat "Asso message:\nLinetype '" LtpNam "' not found in Acadxxx.lin" ))
)
( (ALE_Utl_GetItem LTpCol LtpNam) )
)
)
; Function: ALE_Utl_GetItem
;
; Arguments:
; VlaCol = Collection Object > ex. (vla-get-Layers *AcAcDwg*)
; KeyNam = String > "0"
;
; Return Values:
; VLA-OBJECT or nil if (vla-item) fails
;
; Note:
; the Item method is case-sensitive when used with the SelectionSets
; collection it is not case-sensitive for other collections.
;
; Example:
; (ALE_Utl_GetItem
; (vla-get-Layers (vla-get-ActiveDocument (vlax-get-Acad-Object)))
; "0"
; )
;
(defun ALE_Utl_GetItem (VlaCol KeyNam / VlaObj)
(vl-catch-all-apply
'(lambda ( )
(setq VlaObj (vla-item VlaCol KeyNam))
)
)
VlaObj
)