Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

-attedit 0 found

Anonymous

-attedit 0 found

Anonymous
Not applicable

Hi,

 

I'm trying to write a macro to quickly change a blocks attribute value.

 

when i use -attedit and select the block i get "0 found"

 

the attributes misc settings are all set to "no"

 

Any ideas? This is driving me mad Smiley Surprised

0 Likes
Reply
Accepted solutions (1)
1,620 Views
15 Replies
Replies (15)

cadffm
Consultant
Consultant
And where is your macro? I can t see it.

Sebastian

0 Likes

Anonymous
Not applicable

apologies, the macro is kind of irrelevant as i get the same problem doing it manually.

 

attedit (not -attedit) and eattedit both work fine and bring up the dialogue box when i select the block.

 

even if i use attedit in the macro it acts like -attedit and thus run into the same problem

 

the macro so far is below.:

 


*^C^C_attedit;_y;;;;\

0 Likes

cadffm
Consultant
Consultant

That it did not work manually I had not read out, sorry.

 

a) If the Attribute-Layer is locked, Acad call it in the commandline/Textwindow [F2]

    Objects on locked Layer cant be modify

 

b) If it isnt an Attribut (the Attributdefinition "ATTDEF" is set to constant in your Blockdefinition)

    There is no Attribut on your Blockreference to edit

 

 

 

 

Sebastian

0 Likes

Anonymous
Not applicable

CADffm wrote:

That it did not work manually I had not read out, sorry.

 

a) If the Attribute-Layer is locked, Acad call it in the commandline/Textwindow [F2]

    Objects on locked Layer cant be modify 

All layers are unlocked in both the drawing and the block.

Command line shows "select attributes: 0 found" when block is selected

 

b) If it isnt an Attribut (the Attributdefinition "ATTDEF" is set to constant in your Blockdefinition)

    There is no Attribut on your Blockreference to edit

 Attribute constant is set to "NO" however it is grayed out on the 'edit attribute' dialogue box. see attached image

 

image.png

0 Likes

h_s_walker
Mentor
Mentor

Below is a snippet of code I've got in a visual basic program. Long story short it replaces the REF attribute with a number

Chr$(13) is the equivalent of enter or ; in the case of a macro and ent$ is a space. Yes I know my programming is shoddy.

 

 

"-ATTEDIT N N attriba2a" + Chr$(13) + "REF" + Chr$(13) + "REF" + Chr$(13) + "REF" + Chr$(13) + Job_Number.Text + ent$

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes

cadffm
Consultant
Consultant

And you are clicking on Attribut (not a line or a circle of Block?)

hmm.

 

Please Upload example file with one Blockreference, thx.

Sebastian

0 Likes

pendean
Community Legend
Community Legend

Shouldn't your attribute selection come right after ATTEDIT command? Type it at the commandline and see.

 

 

Otherwise Post your block with the attribute here for all of us to try it.

0 Likes

steven-g
Mentor
Mentor

The greyed out constant looks strange, and without seeing a block then I would go with CADffm's suggestion, the attedit command when used in a macro won't work by selecting just the blocks, you do have to select the actual attribute text if you are going with the one at a time option

0 Likes

Anonymous
Not applicable

Thanks for the responses so far.

 

I've attached the block to see if there's something i'm missing

 

Thanks

0 Likes

pendean
Community Legend
Community Legend
Accepted solution
Your hatch is in the way: erase it or type a longer entry so the attribute goes outside the circle and see for yourself.

Anonymous
Not applicable

THANK YOU!!

0 Likes

akitchensZEZPR
Enthusiast
Enthusiast

This was exactly my issue. Is there a workaround so that I can still use a background hatch in my block?

Making the default text longer so that it sticks out past the hatch works the first time, but once you edit the attribute, it doesn't stick out anymore, so if you need to go back and edit it a second time, you can't.

 

I have made sure that the draworder of the hatch is "send to back" but it is still impairing my ability to select the attribute. I can simply delete the hatch if I have to, but would love to keep it if it's possible.

0 Likes

cadffm
Consultant
Consultant

Create the objects in the order you need, try it again..

 

 

Edit block

copy hatch 0,0 0,0

Erase previous

BSave

 

Still an issue?

Sebastian

0 Likes

akitchensZEZPR
Enthusiast
Enthusiast
After copying then erasing the hatch, I sent it to back, then BSave.
It was still having the same problem.

Then, I changed the text style to Calibri since that has a thicker line weight. This almost worked, but you have to zoom WAYYYY close and click on the text in just the right place. Sadly, this would significantly slow down the editing process, which is no good.

Then I remembered that the background was not actually a solid hatch. It was a SOLID. I sometimes use solids for block backgrounds because it will work with the dynamic stretch function, while hatch does not. But I don't actually need the dynamic stretch function for this particular block, So I deleted that and replaced it with a solid hatch. BINGO! It works now. No need to make the default text longer or anything!

I'm not sure why the Solid was getting in the way, but if anyone else has this problem try replacing it with a hatch.
0 Likes

cadffm
Consultant
Consultant

and also if that wasn't the solution - I wrote it wrong.

Instead of hatch copy.. I mean the object(s) what should be in front.

 

 

Sebastian

0 Likes