linetype manager selecting specific files

linetype manager selecting specific files

Anonymous
Not applicable
448 Views
3 Replies
Message 1 of 4

linetype manager selecting specific files

Anonymous
Not applicable

HI everyone I am looking for help on how to create a lisp that open the linetype manager and then selects the load option, and then the file option then, it should take me to my desired path. I have a screenshot below showing what I mean a little better highlighting the options I want to focus on. My goal is just to have the last window open up so the user may select the linetype folder they desire instead of going through the steps of finding the location of the linetypes in the server.  this would save time on training on my end.  If this is unclear please let me know so I can try to add more information. Thanks

 

 

(defun c:test3 ()
;define the function

(initdia)

(command "linetype" "load" "" "file" "W:\KPFF-CAD Standards\SUPPORT\Line Types"))

(princ)

:clean loading

 

justingonzalez111_1-1634572510416.png

 

0 Likes
449 Views
3 Replies
Replies (3)
Message 2 of 4

pbejse
Mentor
Mentor

@Anonymous wrote:

My goal is just to have the last window open up so the user may select the linetype folder they desire instead of going through the steps of finding the location of the linetypes in the server.  this would save time on training on my end. 

How's about including the folder "W:\KPFF-CAD Standards\SUPPORT\Line Types" on the "Places List" panel. You just need to navigate to a location once, It will be there everytime you do your training

pbejse_0-1634576362976.png

 

0 Likes
Message 3 of 4

Sea-Haven
Mentor
Mentor

Maybe this.

 

 

(setq  doc (vla-get-activedocument (vlax-get-acad-object))) ; open database

(defun loadLinetype (doc LineTypeName FileName)
  (if (and
        (not (existLinetype doc LineTypeName))
        (vl-catch-all-error-p
          (vl-catch-all-apply
            'vla-load
            (list
              (vla-get-Linetypes doc)
              LineTypeName
              FileName
            )
          )
        )
      )
    nil
    T
  )
)

(defun existLinetype (doc LineTypeName / item loaded)
  (vlax-for item (vla-get-linetypes doc)
    (if (= (strcase (vla-get-name item)) (strcase LineTypeName))
      (setq loaded T)
    )
  )
)

;load missing linetypes
;;; returns: T if loaded else nil
(loadLinetype doc "Fence" "custom.lin")

 

0 Likes
Message 4 of 4

Anonymous
Not applicable

hi @pbejse and @Sea-Haven thank you for answering. that would be a very easy fix thank you for the recommendations. But I was also kind of curious if anyone had a way to automate pop up menus  using a lisp. I don't even  know if it possible to do so using a lips. The questions was also out of curiosity of learning more code. thanks

0 Likes