Author Topic: changing attributes within blocks that links to changes in other attributes...  (Read 1416 times)

0 Members and 1 Guest are viewing this topic.

Thorarinn

  • Guest
Hello.  I'm hoping someone can lead me in the right direction, as this is my first major LISP routine, and my LISP knowledge is basic.

I have a drawing with many blocks.  There are 4 possible block names:  BLOCK1, BLOCK 2, BLOCK3, and BLOCK4.

All of the blocks have the same 3 attribute TAGS:
ROW - the row number (the blocks are laid out in alternating rows of 15 and 16 parts)
PARTNAME - This is unique for every individual block,  but it incorporates data from ROW,  specifically, PARTNAME = "blah-blah-ROW#-blah
DATE- doesn't need editing

I want to automate the process of changing the row numbers (for future work) by running a command-line routine that asks for a row number, gives an option to change it, and updates the part of the PARTNAME (a string) with the relevant new row#.   EX: Change AttTag ROW from 1 to 2, and the partname changes from "blah-blah-R1" to "blah-blah-R2"

I don't know how to connect the ROW and PARTNAME data.
Any helpful hints or directions to ebooks or known function subroutines, would really help.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Another good Lisp resource, apart form this forum of course, is http://www.afralisp.net/.

Some questions regarding your intended program:
What is rows #1 to #5 exist and the user changes #2 to #3, resulting in two rows #3?
In your post you are unclear about the formatting of PARTNAME. Is it "*R#" or "*ROW#*"?
Wouldn't using a single table make more sense?

ronjonp

  • Needs a day job
  • Posts: 7529
This sounds like a task for an object field.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC