Jump to content

Recommended Posts

Posted

I wonder if you can do the following ...

1 - Enter (name of command) to enable or disable.

2 - When you click or type to create (line, polyline, circle, etc) Autocad will ask: Continue current layer (Y / N), Change layer (layer name), Create New Layer.

 

The idea is to choose the layer you draw without having to go directly to the toolbar.

 

Is it possible?

Posted

That's would handicapping you from going fast with your works.

 

And what's wrong with the Layer toolbar if it is available in front of you below Cad menu ?

 

Tharwat

Posted

Yes to some extent. Look at the help files for "UNDEFINE".

 

The second would require a command reactor.

Posted

Se7en is correct; I'd use a reactor also, for changing layers.

 

Why would you need to enable/disable commands, in order to draw lines, polylines, ciurcles, etc.?

 

You could create a toolbox function witch accepts a T or nil argument to enable/disable (define/undefine) a command respectively.

Posted

Here's a very crude way, but I use this to quickly create/set current:

 

(defun AT:DummyLayer (name color plot)
 ;;DUMMY LAYERS (CREATES AND/OR SETS AS CURRENT)
 (cond
   ((tblsearch "layer" name)
    (vl-cmdf "_.layer" "_t" name "_s" name "_p" plot name "")
    (princ (strcat "\nLayer: \"" name "\" is the current layer."))
   )
   ((vl-cmdf "_.layer" "_m" name "_c" color name "_p" plot name "")
    (princ (strcat "\nLayer: \"" name "\" has been created."))
   )
 )
)

 

Some of mine:

 ;"ALAN" LAYER
(defun c:ALAN (/) (AT:DummyLayer "ALAN" 2 "P") (princ))

;"TEMP" LAYER
(defun c:TEMP (/) (AT:DummyLayer "TEMP" 7 "P") (princ))

;"VP" LAYER
(defun c:VP (/) (AT:DummyLayer "VP" 4 "N") (princ))

;"HIDE" LAYER
(defun c:HI (/) (AT:DummyLayer "HIDE" 210 "N") (princ))

;"0" LAYER
(defun c:L0 (/) (AT:DummyLayer "0" 7 "P") (princ))

 

However, you could add an additional command if you wanted.

eg.

(defun c:FART (/) (AT:DummyLayer "FART" 3 "P") (command "_.line") (princ))

This will create a plottable layer called "FART" with a color of 3 (Green) and execute the line command.

 

Probably a crappy idea, but an idea none-the-less.

Posted
...

However, you could add an additional command if you wanted.

eg.

(defun c:FART (/) (AT:DummyLayer "FART" 3 "P") (command "_.line") (princ))

This will create a plottable layer called "FART" with a color of 3 (Green) and execute the line command.

 

Probably a crappy idea, but an idea none-the-less.

 

 

What you've dung here is pure, poetic genious. :lol:

Posted
What you've dung here is pure, poetic genious. :lol:

Purely subconscious. Perhaps I'm a little gassy from lunch.

Posted

Titoprax sounds like your trying to create some drafting rules which is good, hard to get people to stick to though. Taking what Alan has done above make a toolbar or menu that has what your trying to do as the heading rather than line on layer x eg "pipe" = layer pipe then draw line, "support" = layer support then draw polyline.

 

We also have some predrawn line work (like a small group of lines with text ) and use make current layer icon before command . Just move it around to the side of where we are working. we have lots of shorthand programs and these are hard coded generally for layer etc.

 

Just remembered there is also some code here pick object and it knows its a line or arc or circle and sets to that layer and then runs that command. Found it! its called copy command search forum here.

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