Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
steve-jones
Posts: 114
Registered: ‎01-25-2001
Message 1 of 7 (673 Views)

layer manager from command line

673 Views, 6 Replies
11-30-2000 06:18 PM
Hello all. I'm trying to get a temporary snapshot of the current layer settings using Express Tools layer manager. I tried (command "-lman" "s" "temp" "") but got an unknown command error (it works when typed in autocad). I then tried (c:-lman) & that works but I can't add the rest of the command with lisp. Any ideas? Thanks in advance. Steve
*Ahava, Petri
Message 2 of 7 (673 Views)

Re: layer manager from command line

11-30-2000 07:11 PM in reply to: steve-jones
Hi,

 

a quick & dirty way is to use a script file to
do this:

 

Scriptfile lman.scr:

 

-lman

save

name

 

Then you can run it with lisp:

 

(command "script" "lman")

 

you can go on and write a lisp that writes the
script file and then runs it.

 

HTH,

 

Petri Ahava

CAD-Center Oy

Helsinki, Finland


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hello
all. I'm trying to get a temporary snapshot of the current layer settings
using Express Tools layer manager. I tried (command "-lman" "s" "temp" "") but
got an unknown command error (it works when typed in autocad). I then tried
(c:-lman) & that works but I can't add the rest of the command with lisp.
Any ideas? Thanks in advance. Steve
Distinguished Contributor
tader1
Posts: 319
Registered: ‎11-01-2004
Message 3 of 7 (673 Views)

Re: layer manager from command line

02-05-2007 04:23 PM in reply to: steve-jones
anyone have a better way to use lman w/in lisp w/out writing a script?
Distinguished Contributor
tader1
Posts: 319
Registered: ‎11-01-2004
Message 4 of 7 (673 Views)

Re: layer manager from command line

02-05-2007 05:09 PM in reply to: steve-jones
what i'm trying to do is take the existing layer state of the dwg and overwrite the last name stored. I looked through Lman.lsp and found bns_sl. This is what I have
(defun c:upd ()
(if (not bns_rl)(load "lman.lsp"))
(if (and (equal (cadr #last_restore) (bns_get_la_status));equal
(member (car #last_restore) (bns_get_layerstates))
)
(progn
(initget "Y N")
(setq ans (strcase (getstring (strcat "\t\tUpdate Lman state" " " "[" (setq LstRstr (nth 0 #last_restore)) "]?:[Y/N]" " Y"))))
(if (= ans "")
(bns_sl (nth 0 #last_restore))))))

but bns_sl doesn't do anything.
Distinguished Contributor
tader1
Posts: 319
Registered: ‎11-01-2004
Message 5 of 7 (673 Views)

Re: layer manager from command line

02-05-2007 06:35 PM in reply to: steve-jones
Think this works.
(defun c:upd ()
(if #last_restore
(progn
(initget "Y N")
(setq ans (strcase (getstring (strcat "\t\tUpdate Lman state" " " "[" (setq LstRstr (nth 0 #last_restore)) "]?[Y/N]" " Y:"))))
(if (or (= ans "") "Y")
(bns_sl (nth 0 #last_restore))))))
Distinguished Contributor
tader1
Posts: 319
Registered: ‎11-01-2004
Message 6 of 7 (673 Views)

Re: layer manager from command line

02-05-2007 07:01 PM in reply to: steve-jones
(defun c:upd ()
(if #last_restore
(progn
(initget "Yes No _Y N")
(setq ans (getKword (strcat "\t\tUpdate Lman state" " " "[" (nth 0 #last_restore) "]?[Y/N]" " :")))
(if (or (not ans) "Y")
(bns_sl (nth 0 #last_restore)))(princ))
(print "No previously saved Lman state"))
(princ))
Distinguished Contributor
tader1
Posts: 319
Registered: ‎11-01-2004
Message 7 of 7 (673 Views)

Re: layer manager from command line

02-05-2007 07:10 PM in reply to: steve-jones
hopefully that was my last mistake:
(defun c:upd ()
(if #last_restore
(progn
(initget "Yes No _Y N")
(setq ans (getKword (strcat "\t\tUpdate Lman state" " " "[" (nth 0 #last_restore) "]?[Y/N]" " :")))
(if (or (= ans "Y") (not ans))
(bns_sl (nth 0 #last_restore)))(princ))
(print "No previously saved Lman state"))
(princ))

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community