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

0 Members and 1 Guest are viewing this topic.

cuthbertdavies

  • Mosquito
  • Posts: 1
Changing Properties using AutoLISP
« on: February 16, 2024, 02:44:06 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.

BIGAL

  • Swamp Rat
  • Posts: 1417
  • 40 + years of using Autocad
Re: Changing Properties using AutoLISP
« Reply #1 on: February 17, 2024, 06:54:06 PM »
It depends on what your doing for example we import a dwg from an external source, and we do multiple things to it, erase blocks by name, set all objects to by layer ,reset layer colors. Add a prefix to certain layers, Blink and you will miss it all happening.
A man who never made a mistake never made anything