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

remove all block attribute values.

16 REPLIES 16
Reply
Message 1 of 17
mid-awe
2904 Views, 16 Replies

remove all block attribute values.

Hi all,

 

I need a lisp sub-function that can empty all attributes of a specified dynamic block. The idea being that the specified block contains data that changes often and in order to repopulate the block's attributes with new data to replace the old I wish to just blank out the old data first, because it's possible that the new data may not utilize as many attributes and all of the old data must be removed.

 

The thing is the block I'm after is on several layouts, CTABs and they all need to be wiped clean.

 

Please and thank you Smiley Happy

16 REPLIES 16
Message 2 of 17
3wood
in reply to: mid-awe

I have tried the following steps and it was quite successful.

1. Use FILTER to select all concerned blocks. When it prompts to select objects, type "ALL" to select blocks in all layouts.

2. Use ATTOUT to export selected block attribute information as a file. When it prompts to select objects, type "P" to use the selection set made in Step 1.

3. Use MS Excel to edit the attribute information file, Keep the first row and left-hand two columns and clear contents in all other cells. (Select these cells then press DELETE key). Save the file.

4. Back to AutoCAD, use command ATTIN to import the file you just saved.

 

You need have Express Tools installed to use command ATTOUT and ATTIN.

Message 3 of 17
mid-awe
in reply to: 3wood

Thanks, I'll give that a try.
Message 4 of 17
pbejse
in reply to: mid-awe


@mid-awe wrote:

Hi all,

 

The thing is the block I'm after is on several layouts, CTABs and they all need to be wiped clean.


I dont see any reason why CTAB would be a problem. Not if your using autocad native commands then you will need to run thru the tabs with layoutlist function.

 

Message 5 of 17
pbejse
in reply to: pbejse

or probably your ssget filter mode:

 

(ssget "_X" (list  '(0 . "INSERT")'(66 . 1)(cons 1 "Blockname"))(cons 410 (getvar 'Ctab))) ;<--- or something to that efffect.. which only sellect target objects on the current tab

 

Could be, who knows, unless you post your code here mid-awe.

 

Message 6 of 17
mid-awe
in reply to: pbejse

I'm working it out. I did use the ssget filter for the current tab so that I would know how many attributes to replace with nothing. I'm working out the loops to replace all values in the block on all tabs (to be named). I also prefer to set a number where to start replacing values.

My code is too ugly to post right now, but I'm looking for a generic sub-function that I can call with maybe two arguments, block-name & attribute-number where to begin.

Thank you.
Message 7 of 17
pbejse
in reply to: mid-awe


@mid-awe wrote:

My code is too ugly to post right now, but I'm looking for a generic sub-function that I can call with maybe two arguments, block-name & attribute-number where to begin.

Thank you.

Well then, if no code. then a sample drawing will do just tthe same. 

 

 

 

Message 8 of 17
pbejse
in reply to: mid-awe


@mid-awe wrote:
My code is too ugly to post right now, but I'm looking for a generic sub-function that I can call with maybe two arguments, block-name & attribute-number where to begin.

Thank you.

Change attribute multiple paper space tabs <--- look here

 

Message 9 of 17
mid-awe
in reply to: pbejse

Thank you. I was unable build the generic function that I was looking for because I do not know how to acquire the tag names, but I did build a little wrapper for chgatt function to target the specific blocks I need to reset to blank.
Message 10 of 17
pbejse
in reply to: mid-awe


@mid-awe wrote:
Thank you. I was unable build the generic function that I was looking for because I do not know how to acquire the tag names, but I did build a little wrapper for chgatt function to target the specific blocks I need to reset to blank.

So you're good mid-awe? no need for modification? I guess you got it covered then.

 

Cheers

Message 11 of 17
BlackBox_
in reply to: mid-awe


@mid-awe wrote:

Hi all,

 

I need a lisp sub-function that can empty all attributes of a specified dynamic block. The idea being that the specified block contains data that changes often and in order to repopulate the block's attributes with new data to replace the old I wish to just blank out the old data first, because it's possible that the new data may not utilize as many attributes and all of the old data must be removed.

 

The thing is the block I'm after is on several layouts, CTABs and they all need to be wiped clean.

 

Please and thank you Smiley Happy


If this is something that you depend on quite often, you're far better off having your attributed dynamic block reference Sheet Set Manager (SSM) Custom Properties, as this allows you to change the data items in SSM without openeing any drawings at all and can then immediately be published. Done.

 

I use this with out title block (which is also dynamic to allow for different sheet types), and this methodology has been invaluable... One project alone was +/-550 sheets, and I'd simply close all drawings, change the necessary properties, and then publish. Lemon squeezy.



"How we think determines what we do, and what we do determines what we get."

Message 12 of 17
pbejse
in reply to: BlackBox_


@BlackBox_ wrote:
Sheet Set Manager (SSM) Custom Properties, as this allows you to change the data items in SSM without openeing any drawings at all and can then immediately be published. Done


Really? wow. i have to look into that. never realized ACAD2009 have that Sheet Set capability 😄 its been a long time since i browse thru the menu's [i'm so retarded]

 

Thanks for the info BlackBox.

 

Message 13 of 17
BlackBox_
in reply to: pbejse


@pbejse wrote:

@BlackBox_ wrote:
Sheet Set Manager (SSM) Custom Properties, as this allows you to change the data items in SSM without openeing any drawings at all and can then immediately be published. Done


Really? wow. i have to look into that. never realized ACAD2009 have that Sheet Set capability 😄 its been a long time since i browse thru the menu's [i'm so retarded]

 

Thanks for the info BlackBox.

 


You're welcome... Ctrl+4 is your friend. :beer:

 

SSM is a fantastic tool that hasn't really changed since +/-2006? It's really good at what it does do, and it has some pretty blatent gaps... For tasks such as this, it's quite powerful, which is why I've been using it for every project since learning of its capabilities (small or large).

 

It requires some planning, obviously, because each attribute in one's title block, for example, needs to be correctly mapped to the correct SSM Custom property by Field. The implied tasks are to keep SSM Custom Properties organized by naming convention, and to remember to specify the correct case for the Field value (so if you enter upper or lower case in SSM custom property, the title block still looks right), etc..

 

I hope others find this method to be as useful as I have.

 

Cheers

 

 

 

P.S. for the developers - SSM API features are only exposed to VBA, and .NET API. For more information, see the Overview of Sheet Set Manager Objects (SSO) developer reference.

 



"How we think determines what we do, and what we do determines what we get."

Message 14 of 17
BlackBox_
in reply to: pbejse


@pbejse wrote:
never realized ACAD2009 have that Sheet Set capability 😄 

My favorite things about 2009....

 

PUBLISHCOLLATE System Variable, and the LayerState-* LispFunctions were introduced... Later with SP1 (maybe SP2?), the Ribbon became editable via CUI Editor (you couldn't edit its contents at all previously, just it's displayed position).

 

[Edit] - Oh! And the death of Land Desktop - hooray beer!!!

 

/WalkDownMemoryLane



"How we think determines what we do, and what we do determines what we get."

Message 15 of 17
pbejse
in reply to: BlackBox_


@BlackBox_ wrote:

@pbejse wrote:
never realized ACAD2009 have that Sheet Set capability 😄 

My favorite things about 2009....

 

PUBLISHCOLLATE System Variable, and the LayerState-* LispFunctions were introduced... Later with SP1 (maybe SP2?), the Ribbon became editable via CUI Editor (you couldn't edit its contents at all previously, just it's displayed position).

 

[Edit] - Oh! And the death of Land Desktop - hooray beer!!!

 

/WalkDownMemoryLane


Nice to know ACAD2009 is not really that ancient 🙂 All this time i thought the only new stuff here are DBlocks and Annotative objects  i'll be more observant from now on. But then again, not really a heavy CAD user. just the basic stuff and some lisp programming .. [ yeah right!!!] 

 

Cheers BlackBox :beer!

 

**//Off Topic//**

 

 

Message 16 of 17
BlackBox_
in reply to: pbejse

Cheers, pbejse :beer:



"How we think determines what we do, and what we do determines what we get."

Message 17 of 17
mid-awe
in reply to: BlackBox_

Depend on it daily. I'm in the same boat with pbejse. I've never had a reason to take a look at the SSM until now. Thank you for the tip 🙂

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

Post to forums  

Autodesk Design & Make Report

”Boost