Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ATTOUT / ATTIN for Dynamic Blocks on Multiple Layouts

4 REPLIES 4
Reply
Message 1 of 5
JGranata_GdB
1184 Views, 4 Replies

ATTOUT / ATTIN for Dynamic Blocks on Multiple Layouts

Background: 

Our title block has multiple attributes, and we used a modified ATTOUT command to export attributes from multiple layouts to quickly modify them (Using the advice from https://cadtips.cadalyst.com/attributed-blocks/access-block-attributes-across-multiple-file-tabs to create the modification). After making the mass changes, we bring the attributes in using the standard ATTIN command. 

Recently, we have updated our Title block to use visibility states (for a few different reasons). In doing so, the visibility states makes the title block a dynamic block. 

 

The issue: 

I attempted to use the original ATTOUT modification (from Cadalyst ) and was prompted with "No valid objects selected." in the command line. I realized this was most likely because the title block is now a dynamic block due to the visibility state and the selection set is not properly selecting the block.

Searching the forums, I found a previous post about exporting and importing dynamic block attributes, a modified Attin/Attout code by Brice Studer. ( https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/attin-attout-with-dynamic-blocks/m-p...). This works great when all the dynamic block attributes are in the same space/layout. 

I tried to apply the same Cadalyst tip to Brice's code, however when I change the selection, the same command line comments of "No valid objects selected." occurs when i attempt to select the title block. 

 

Question:

Is there a way to modify Brice's code to export the attribute data for dynamic blocks across multiple layouts/spaces by only selecting one block? If not is there another way, that is almost as quick as ATTOUT and ATTIN, to modify attributes values for a title block across multiple layouts in a drawing? 

 

I have just started to learn how to deal with dynamic blocks in LISP/coding and sometimes it feels like they are more trouble than they are worth.  

4 REPLIES 4
Message 2 of 5
ВeekeeCZ
in reply to: JGranata_GdB

THIS  Lee's routine won't help?

Message 3 of 5
jtohill
in reply to: JGranata_GdB

Wondering why you are not using sheetset to do your title blocks.

Message 4 of 5
clindner
in reply to: JGranata_GdB

@JGranata_GdB,

 

Try this to solve the "No valid objects selected." issue. In Brice's program, replace line 65

((not (setq ss (ssget '((0 . "INSERT") (66 . 1))))

with

((not (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 "`*U*")(cons 66  1))))

The issue I see is that the program only partially accommodates dynamic block names (lines 167, 168, 359, & 360). Line 65, specifically, doesn't recognize if a user selects a dynamic block. (Note: I didn't have time to test this code change myself. Sorry.)

 

The layout looping issue is definitely possible, but will require more coding than I have time for right now.  If no one else jumps in, I'll try to get back to it.

 

Cheers,


Please use the Accept as Solution or Kudo buttons when appropriate

Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors

Message 5 of 5
JGranata_GdB
in reply to: JGranata_GdB

@ВeekeeCZ  and @jtohill I will look into the Lee Mac link. Initially I was looking for an attribute out for dynamic blocks that was a bit more general in function so the user - if wanted - can modify any and all the fields of a dynamic attribute block without needing to know the tag names prior, or the option to modify multiple attributed blocks on the same layout (more in line with metadata for certain features) in the AutoCAD software. The title block example was the easiest to convey in a forum/text since they are more universally used. 

 

From the Lee Mac link, I may be able to get something to work with the "LM:al-effectivename" or see how Lee deals with dynamic blocks in his code. 

 

@clindner Thanks for that suggestion. It is almost working - that change exports all attributed blocks (dynamic or not) without the need for a selection. Ideally using a selection to only get the attributes from one block (dynamic or not) would be ideal. 

 

Thanks all so far for the quick replies. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report