Author Topic: Changing Properties using AutoLISP  (Read 1477 times)

0 Members and 1 Guest are viewing this topic.

SanganakSakha

  • Mosquito
  • Posts: 2
Changing Properties using AutoLISP
« on: September 13, 2023, 05:00:04 AM »
Hello All,

While exploring various forums I cam across multiple requests for code to change properties of objects, especially to ByLayer.

After spending some time on analyzing the problems and proposed solutions, I realized that for changing properties of objects, using combination of following commands is sufficient if you are working in a single drawing:
- QSELCT / SETBYLAYER / CHPROP / Properties dialog box

Both SETBYLAYER / CHPROP commands provide with all the selection options including Selection Sets (created by AutoLISP).
With QSELEST, you can select multiple objects with complex selection criteria and use that selection as input to SETBYLAYER / CHPROP commands. 
The SETBYLAYER command gives you an option to propagate the changes to the Block Definition.

So, what are the compelling reasons for using code (AutoLISP or any other language) for changing properties?

Here are some of the situations I have identified:
1. Block Definition that does not have in Block Reference in the drawing (since Block Definition can not be selected interactively).
2. Different styles (only if in large numbers): DIMSTYLE (NOT dims), MLINESTYLE, MLEADERSTYLE, TABLESTYLE, VISUALSTYLE
If you want to make changes only to few styles, you can edit them manually.

This is not an exhaustive list. So, what do you think are the situations / circumstances in which code will be necessary to modify object properties.
(Batch Processing is a different story).

Your responses are welcome.

 

Vaidas

  • Newt
  • Posts: 66
Re: Changing Properties using AutoLISP
« Reply #1 on: September 13, 2023, 05:23:45 AM »
I change properties by lisp if they are dependent on some of attribute value, xdtata value etc, e.g. Color by rebar diameter.
(mapcar 'chr '(107 105 116 111 120 46 99 111 109))