Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

editing commands

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
M_c3d
1077 Views, 12 Replies

editing commands

M_c3d
Advisor
Advisor

I am editing some commands at the moment to set the layers etc before they are done, so for qleaders, i want this to be on the layer 'Dim'

 

I've changed the macro to;

 

-layer;set;Dim;^C^C_qleader

 

this works fine, exactly the way I want it to.

 

The only problem is it only works for the command fro the ribbon, it doesnt work when typing the qleader command.

 

Is there any way to apply it for both?

0 Likes

editing commands

I am editing some commands at the moment to set the layers etc before they are done, so for qleaders, i want this to be on the layer 'Dim'

 

I've changed the macro to;

 

-layer;set;Dim;^C^C_qleader

 

this works fine, exactly the way I want it to.

 

The only problem is it only works for the command fro the ribbon, it doesnt work when typing the qleader command.

 

Is there any way to apply it for both?

12 REPLIES 12
Message 2 of 13
Alfred.NESWADBA
in reply to: M_c3d

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> it doesnt work when typing the qleader command

You might try to create a small LISP function which does the layer setting + the leader command start for you

 

(defun C:QL()
   (command "_-LAYER" "_MAKE" "XXX" "")
(command "_.QLEADER") )

This small part gives you a new command "QL" (you can name it as you like as long as it's not a already existing command name).
This command can be used in the menu as well as by typing using your keyboard.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)

Hi,

 

>> it doesnt work when typing the qleader command

You might try to create a small LISP function which does the layer setting + the leader command start for you

 

(defun C:QL()
   (command "_-LAYER" "_MAKE" "XXX" "")
(command "_.QLEADER") )

This small part gives you a new command "QL" (you can name it as you like as long as it's not a already existing command name).
This command can be used in the menu as well as by typing using your keyboard.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 13
pendean
in reply to: M_c3d

pendean
Community Legend
Community Legend
Button macros do not automagically become typable commands: you will need to convert your macro to a LISP, load the LISP, then use that LISP instead.

Are you actually using AutoCAD, or just LT?

Button macros do not automagically become typable commands: you will need to convert your macro to a LISP, load the LISP, then use that LISP instead.

Are you actually using AutoCAD, or just LT?
Message 4 of 13
Kent1Cooper
in reply to: M_c3d

Kent1Cooper
Consultant
Consultant
Accepted solution

Basic AutoCAD has an option for always putting Dimensions on a Layer of your choice, whatever the current Layer, but apparently not Leaders.  But I think some of the overlay programs have that kind of option for more things -- whether Civil3D [my assumption, from your avatar image] does, and if so whether Leaders are included, I don't know.

 

But you can make a new definition of the command to do it for you.  Put this into acaddoc.lsp, so it will be loaded in every drawing:

 

(command "_.undefine" "QLEADER")

(defun C:QLEADER () (setvar 'clayer "Dim") (command "_.qleader"))

 

Then, no matter how you call up the command [from the ribbon, type in, other menu item, alias*, etc.], it will go to that Layer.  You can do the same for LEADER, for when you want the "slow" variety.

 

It could be enhanced to save the current Layer when it's called, and set that current again after you're done, if you like.

 

*EDIT:  I tried it, and I find that with the native QLEADER command undefined, the standard LE alias for it does not work, so if you want that, you'd have to make that a command, too:

 

(defun C:LE () (setvar 'clayer "Dim") (command "_.qleader"))

or with the earlier QLEADER new definition, just:

(defun C:LE () (C:QLEADER))

Kent Cooper, AIA

Basic AutoCAD has an option for always putting Dimensions on a Layer of your choice, whatever the current Layer, but apparently not Leaders.  But I think some of the overlay programs have that kind of option for more things -- whether Civil3D [my assumption, from your avatar image] does, and if so whether Leaders are included, I don't know.

 

But you can make a new definition of the command to do it for you.  Put this into acaddoc.lsp, so it will be loaded in every drawing:

 

(command "_.undefine" "QLEADER")

(defun C:QLEADER () (setvar 'clayer "Dim") (command "_.qleader"))

 

Then, no matter how you call up the command [from the ribbon, type in, other menu item, alias*, etc.], it will go to that Layer.  You can do the same for LEADER, for when you want the "slow" variety.

 

It could be enhanced to save the current Layer when it's called, and set that current again after you're done, if you like.

 

*EDIT:  I tried it, and I find that with the native QLEADER command undefined, the standard LE alias for it does not work, so if you want that, you'd have to make that a command, too:

 

(defun C:LE () (setvar 'clayer "Dim") (command "_.qleader"))

or with the earlier QLEADER new definition, just:

(defun C:LE () (C:QLEADER))

Kent Cooper, AIA
Message 5 of 13
M_c3d
in reply to: pendean

M_c3d
Advisor
Advisor

civil 3d; which is built on top of full autocad & map 3d

civil 3d; which is built on top of full autocad & map 3d

Message 6 of 13

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> (setvar 'clayer "Dim")

Just to add .. for that statement the layer "Dim" has already to exist in your drawing.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)

Hi,

 

>> (setvar 'clayer "Dim")

Just to add .. for that statement the layer "Dim" has already to exist in your drawing.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 7 of 13

Kent1Cooper
Consultant
Consultant

@Alfred.NESWADBA wrote:

.... 

>> (setvar 'clayer "Dim")

Just to add .. for that statement the layer "Dim" has already to exist in your drawing.

....


True, and I assume it does, since the macro in Post 1 only sets it, and "works fine" for the OP.  But if it might not always, forcing it to, as in Post 2, can be included.

Kent Cooper, AIA


@Alfred.NESWADBA wrote:

.... 

>> (setvar 'clayer "Dim")

Just to add .. for that statement the layer "Dim" has already to exist in your drawing.

....


True, and I assume it does, since the macro in Post 1 only sets it, and "works fine" for the OP.  But if it might not always, forcing it to, as in Post 2, can be included.

Kent Cooper, AIA
Message 8 of 13

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> True, and I assume it does, since the macro in Post 1 only sets it, and "works fine"

;)))

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)

Hi,

 

>> True, and I assume it does, since the macro in Post 1 only sets it, and "works fine"

;)))

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 9 of 13
M_c3d
in reply to: Kent1Cooper

M_c3d
Advisor
Advisor

Hi All,

 

Thanks for all the replies @Kent1Cooper solution does the job, it means I don't need to edit the cui and forces the standard for all commands.

 

Thanks for all the suggestions.

 

This only applies to 2d qleaders etc, its going to be applied to dims, hatches, viewports etc

 

Civil 3d has the label and leader as one layer and the colour defined within the label. 

 

Civil 3d is my main software, but I am also responsible for building a new set of cad standards for autocad users that work with both civil 3d and autocad (hence the question of forcing layer management)

 

0 Likes

Hi All,

 

Thanks for all the replies @Kent1Cooper solution does the job, it means I don't need to edit the cui and forces the standard for all commands.

 

Thanks for all the suggestions.

 

This only applies to 2d qleaders etc, its going to be applied to dims, hatches, viewports etc

 

Civil 3d has the label and leader as one layer and the colour defined within the label. 

 

Civil 3d is my main software, but I am also responsible for building a new set of cad standards for autocad users that work with both civil 3d and autocad (hence the question of forcing layer management)

 

Message 10 of 13
M_c3d
in reply to: Kent1Cooper

M_c3d
Advisor
Advisor

Hi All,

 

Hoping for some additional help in this regard, setting default layer for hatches;

 

(command "_.undefine" "Hatch")
(defun C:Hatch () (setvar 'clayer "Hatch") (command "_.Hatch"))

 

That bit works fine, but it runs the hatch command with HPDLGMODE set to 0 rather than the 1 that it is set to, so in effect it does not open the dialog box.

 

Any way to fix this?

 

Thanks in advance

0 Likes

Hi All,

 

Hoping for some additional help in this regard, setting default layer for hatches;

 

(command "_.undefine" "Hatch")
(defun C:Hatch () (setvar 'clayer "Hatch") (command "_.Hatch"))

 

That bit works fine, but it runs the hatch command with HPDLGMODE set to 0 rather than the 1 that it is set to, so in effect it does not open the dialog box.

 

Any way to fix this?

 

Thanks in advance

Message 11 of 13
cadffm
in reply to: M_c3d

cadffm
Consultant
Consultant
Accepted solution

You know about HPLAYER and DIMLAYER or do you have an old version?

 

 

Sebastian

You know about HPLAYER and DIMLAYER or do you have an old version?

 

 

Sebastian

Message 12 of 13
M_c3d
in reply to: cadffm

M_c3d
Advisor
Advisor

Nope I did not know of these! Thanks!

 

I knew of XREFLAYER but didn't know of the others.

 

Are there any others?  One for viewports perhaps?

0 Likes

Nope I did not know of these! Thanks!

 

I knew of XREFLAYER but didn't know of the others.

 

Are there any others?  One for viewports perhaps?

Message 13 of 13
Kent1Cooper
in reply to: M_c3d

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

.... it runs the hatch command with HPDLGMODE set to 0 rather than the 1 that it is set to, so in effect it does not open the dialog box.

 

Any way to fix this?

 

....

(command "_.undefine" "Hatch")
(defun C:Hatch () (setvar 'clayer "Hatch") (initdia) (command "_.Hatch"))

Kent Cooper, AIA


@Anonymous wrote:

.... it runs the hatch command with HPDLGMODE set to 0 rather than the 1 that it is set to, so in effect it does not open the dialog box.

 

Any way to fix this?

 

....

(command "_.undefine" "Hatch")
(defun C:Hatch () (setvar 'clayer "Hatch") (initdia) (command "_.Hatch"))

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report