Jump to content

Recommended Posts

Posted

I want to bypass the linetype manager. Does anyone know the command line entry for this?

 

And I also will need to reload all of the linetypes in that file regardless of name.

 

i'm trying to create a macro to do this.

 

*So far, by typing -linetype I can get a few options and I can select a .lin file but not sure how to reload the lot.

Posted

you will need to set your FILEDIA variable to a value of 0, to enable all commandline functionality of this.

Remember to set it back to a value of 1 once you are finished, also.

Posted

I tried this but it still doesn't work.

 

currently the best I;ve got is

 

-Linetype & this gives me options to name linetypes to reload and will open the folder containing my .lin files if I ask for an unrecognised linetype I just need to reload all of them.

Posted

You may need to set variable EXPERT to a value of 3 (remember to reset it back to its original value afterwards), and you can also use * as the wildcard to reload all of the linetypes

Posted

Something like this?

 

(defun load_lin (fname / ofile nl pos lst)
 (vl-load-com)
 (setq ltcol (vla-get-linetypes
               (vla-get-ActiveDocument
                 (vlax-get-acad-object))))
 (if (setq ofile (findfile fname))
   (progn
     (setq ofile (open ofile "r"))
     (while (setq nl (read-line ofile))
       (if (and (eq (chr 42) (substr nl 1 1))
                (setq pos (vl-string-position 44 nl)))
         (setq lst (cons (substr nl 2 (1- pos)) lst))))
     (close ofile)
     (foreach lt (reverse lst)
       (vl-catch-all-apply
         (function
           (lambda ( )
             (vla-load ltcol lt fname))))))
   (princ (strcat "\n<< " fname " not found >>")))
 (princ))    

(defun c:test ()
 (mapcar 'load_lin '("acad.lin" "acadiso.lin"))
 (princ))

Posted

Unfotunately the above script didn't work.

 

Also still having problems getting all linetypes to reload when using command line approach.

 

Also I want to specify a .lin file in the command line but still having problems

Posted

I've put the below code into a script file, and it works no problem:

expert
3
filedia
0
cmddia
0
-linetype
l
*
"ENTER THE FILEPATH OF YOUR LINETYPES FILE HERE"
cmddia
1
filedia
1
expert
0

Posted
Unfotunately the above script didn't work.

 

Also still having problems getting all linetypes to reload when using command line approach.

 

Also I want to specify a .lin file in the command line but still having problems

 

Are you referring to my post? If so, I have posted a LISP, not a script.

Posted

NBC I see where I was going wrong. I put the * instead of 'l' * and also wasn't typing the full file name, just the name of my .lin file.

 

Lee I'll check your lisp and then decide which method to adopt. Not got time to do at this minute. I think I'll prob write a macro though though as want to create some buttons for other users to click to try and resolve any linetype issues though could link the button to a lisp or script.

 

Thanks for your help guys.

 

*edit*

I thought of a problem though with doing this. Some users may have different support file paths for their .lin file as people are using different versions of AutoCAD so I'm wondering if it's possible to (via the command line) change where their support paths are looking for their .lin files so I can aim them to one place on our server. Then I can also add more linetypes for everyone as needed.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...