ATTIN but ignore certain attributes

ATTIN but ignore certain attributes

spagmess
Contributor Contributor
1,269 Views
1 Reply
Message 1 of 2

ATTIN but ignore certain attributes

spagmess
Contributor
Contributor

I use ATTOUT and ATTIN to pass block attribute data back and forth between Autocad and an Excel sheet that crunches the data and adds or modifies some of the values.

 

I've recently created a feature that needs XYZ insertion point data in decimal form. Since the Data Extraction tool is too clumsy for my purposes, and ATTOUT fits with my workflow, I just added X_POS, Y_POS, and Z_POS attributes with defaults set to Insertion Point.

 

It works great using ATTOUT, but ATTIN will break the calculated fields and replace them with text from the txt file. Then if blocks move, the XYZ position attributes don't get updated. I can delete the attributes from the txt file, but that gets cumbersome. I'd prefer to keep the txt file intact and have ATTIN ignore or skip any number of attributes with specific names. Is there an if statement or something I could insert somewhere into ATTIN to define those attribute names?

 

Alternately, if there were a routine to batch restore only the XYZ attributes to their defaults, I could break the calculated fields with impunity and just restore them after ATTIN. There could be a several thousand blocks in a drawing, many with XYZ attributes, some without.

 

LISP is still mostly Greek to me at this point; if anyone can point me in the right direction or suggest an better way, I'd much appreciate it!

0 Likes
Accepted solutions (1)
1,270 Views
1 Reply
Reply (1)
Message 2 of 2

spagmess
Contributor
Contributor
Accepted solution

After six hours of banging my head on the LISP language, I made a single, solitary if statement that solves my problems!

 

Added:

        (if (and(not(equal "X_POS" (car a)))
            (not(equal "Y_POS" (car a)))
            (not(equal "Z_POS" (car a)))

            )

before:

(setq lst4 (cons a lst4))

)

 

Horray!