Does AutoCAD have a command to stablish a current linetype (or other properties) from a selected element?

Does AutoCAD have a command to stablish a current linetype (or other properties) from a selected element?

joantopo
Mentor Mentor
1,188 Views
8 Replies
Message 1 of 9

Does AutoCAD have a command to stablish a current linetype (or other properties) from a selected element?

joantopo
Mentor
Mentor

Hi.

Is there any way to put the properties of a selected element in the drawing as the current properties?

For example, if I select a polyline with red color then Red color will be the current (active) color.

 

In MicroStation there is the "SmartMatch" button to do this.

 

Thanks!

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
0 Likes
Accepted solutions (1)
1,189 Views
8 Replies
Replies (8)
Message 2 of 9

joantopo
Mentor
Mentor

I have found this:

https://forums.autodesk.com/t5/autocad-forum/setting-current-properties-from-an-existing-object/m-p/...

 

AddSelected is not exactly the same (but I like it) and it seems that there is a lisp.

 

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
0 Likes
Message 3 of 9

Patchy
Mentor
Mentor
0 Likes
Message 4 of 9

Kent1Cooper
Consultant
Consultant
Accepted solution

@Patchy wrote:

The MAKEMORE is what you need.


That link is to the SETAS command, by Mosad H. Elewa.  

I thought it was a good idea, but saw some possible improvements [it doesn't localize variables, it doesn't match all available properties, if you miss in picking twice it gives up on you, it doesn't use (initget)/(getkword) correctly, and a few other little things].

So I wrote MakeMore.lsp with its MM command, the most recent version of which is available >here<.  [An earlier version is elsewhere on the Cadalyst CAD Tips site.]  One of its main benefits is its ability to recognize characteristics of certain objects that might have been drawn with a variety of commands [for example, if you pick a Polyline rectangle, it can tell it's a rectangle, and offers the RECTANG command as a default, rather than just calling up the basic PLINE command -- this is also a benefit over AutoCAD's ADDSELECTED command, which the original MM far predates].  It offers options for all the commands that might have been used to make the selected item.  See the description there and at the top of the file for more information.

 

HOWEVER:  Both SETAS and MM not only set the properties of what you select current, but also start a command to make more like it.  If you want only to set the properties, that much could be extracted from either of them into a separate command.

Kent Cooper, AIA
0 Likes
Message 5 of 9

Valentin_CAD
Mentor
Mentor

@joantopo ,

 


@joantopo wrote:

Is there any way to put the properties of a selected element in the drawing as the current properties?

For example, if I select a polyline with red color then Red color will be the current (active) color.

 

In MicroStation there is the "SmartMatch" button to do this.


 

There is not an exact command like "SmartMatch", but why would LAYMCUR or MATCHPROP not be the right command?

 

Apart from selecting the desired properties directly from the Properties.

valentin_0-1627225857022.png

 



Select the "Mark as Solution" if my post solves your issue or answers your question.

Seleccione "Marcar como solución" si mi publicación resuelve o responde a su pregunta.


Emilio Valentin

0 Likes
Message 6 of 9

ChicagoLooper
Mentor
Mentor

@joantopo wrote:

<<Is there any way to put the properties of a selected element in the drawing as the current properties?.....I select a polyline with red color then Red color will be the current (active) color.>>


 

Generally speaking, when you force red to be the 'current color' it means from that point forward, all objects drawn, would be red too. This will be true regardless of the hosting layer's color. So if you draw a polyline on a layer that's yellow, the line will be red, not yellow, because your RED overrides the layer's yellow. Many users do not follow this color overriding type of workflow. It is not considered a Best Practice.

 

A better, more appropriate, way is to establish color ByLayer. You can tell whether ByLayer is in effect by going to the Properties Palette and looking at COLOR under the General Section. If the color displays 'ByLayer' then you're good to go.

 

ByLayer means all objects residing on that layer will adopt that layer's color. By making the LAYER itself current, you are effectively changing, or controlling, an object's color through the Layer Properties Manager and not through the Properties Palette.

 

If you are ambitious you can invest your time to create a Custom Tool Palette with customized commands that streamline your object creation with layer management. In the image below, there are four polyline commands as evidenced by the four pline icons, All icons execute the same command with one exception, each icon places the pline on a different layer.

 

Image-1: the polyline Bldg icon palces a polyline on the Buildinlayer.

Image-1.Image-1.

 

Image-2: the polyline Bldg-Int icon places polyline on the Bldg Interior layer.

Image-2.Image-2.

 

Image-3: The rectangle command places a rectangle on the Bldg Footprint layer.

Image-3.Image-3.

 

Regardless of the current layer and the current layer's color, the polyline/rectangle will be drawn on its correct layer. The object's color will be correct too because when the object is drawn on its correct layer, it will adopt that layer's color. 

 

 

Chicagolooper

EESignature

Message 7 of 9

Kent1Cooper
Consultant
Consultant

@Valentin_CAD wrote:

.... why would LAYMCUR or MATCHPROP not be the right command? ....


[Because they don't do what's requested in Message 1.  LAYMCUR sets only the Layer of the selected object current, but no other properties.  MATCHPROP imposes the properties of the selected object on other already-drawn objects, but does not make any of them current.]

Kent Cooper, AIA
0 Likes
Message 8 of 9

joantopo
Mentor
Mentor

Hi @ChicagoLooper 

Can you associate a custom command for your custom button in the Tool Palette?

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
0 Likes
Message 9 of 9

ChicagoLooper
Mentor
Mentor

That's a vague question, so here's a vague answer. Yes, you can. 

 

Example: You can 'customize the Command String' for four different MTEXT commands. Why four distinct commands and not just one? Because each command string will use a different TEXT STYLE. If you simply invoke the plain ol' mtext command from the ribbon it will make your text use the current text style, whatever that text style may be.

 

101.png

 

 

The image above illustrates one example where you can customize a Tool Palette Command. Use your imagination to create more. 

Chicagolooper

EESignature

0 Likes