Jump to content

Command line macro


Recommended Posts

^C^C_LA;S;Lines;^C^C_Linetype;S;HIDDEN;^C^C_lineweight;.09;^C^C_Color;008;^C^C_line

^C^C_LA;S;Lines;^C^C_Linetype;S;CONTINUOUS;^C^C_lineweight;.18;^C^C_Color;008;^C^C_line

These 2 macros work perfectly. Can you tell what I can add to the end to change back to the layer before I ran this command. I need to reset it to layer Construction all with BYLAYER

 

Thank you

Link to comment
Share on other sites

The command layerp will change back to the last altered layer setting, unfortunately your macro at the moment finishes by starting the line command, and there is no way to run a macro that will let you draw infinte line segments and then run another command. You could try this

^C^C_LA;S;Lines;^C^C_Linetype;S;HIDDEN;^C^C_lineweight;.09;^C^C_Color;008;^C^C_line;\\;layerp;

But it will only allow you to draw a single line segment

Link to comment
Share on other sites

Same problem, the double backslash at the end of the macro lets you pick a start point and a second point the ";" tells the macro to finish the line command and move onto the next command, you could use \\\\; to allow four pick points etc, the same goes for polyline. If the number of pick points is constant then no problem, but there is no way in a macro to have an undefined number of points, maybe it's possible in LISP.

Link to comment
Share on other sites

You can do a lisp version of what you have as either a series of commands or saved as a single lisp

;menu part
^C^C(load "xxxx")
; this xxxx.lsp saved on hard drive
(setq oldlay (getvar "clayer"))
(setvar "clayer" "Lines")
(setvar "Linetype" "HIDDEN)
(setvar "lineweight" 0.09)
; here is a pline just change to Line etc
; create pline by picking points press enter when finished
(command "_pline")
(while (= (getvar "cmdactive") 1 ) (command pause)
)
(setvar "clayer" oldlay)

Link to comment
Share on other sites

Hi Bigal

 

Thanks for the reply. This looks very promising. Can you change the first part to be similar to lots of other lisps I have. EG (defun C:tozalines () My command line can then be tozalines

Link to comment
Share on other sites

Hi Bigal

 

I have been trying this one out and it works up to changing the layer to lines but after that it won't change the linetype to hidden. It keeps the line type setting for layer Lines. Is there something that might be missing here?

 

Regards

 

Tony

Link to comment
Share on other sites

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...