Anuncios

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

Automatic block attributes value.

arnasvel
Participant

Automatic block attributes value.

arnasvel
Participant
Participant

Hello again,

I have an issue. I have a tree icon block and in attributes I need to change the value for "numeris".
It's supposed to be in order from 1 to whatever it is in dwg file.
Is there any possibility to do this automatically? 

I putting on a screenshot for it to be more clear. The upper tree with red arrow supposed to be 1 (first). The second supposed to be 2 (second) and so on. So is there any possibility to change these exact values auto?

Screenshot 2023-01-13 at 16.15.29.png

@arnasvel 

The topic title has been edited to improve findability by @alina.balkanskaia. Original: Automatic block attributes value.

0 Me gusta
Responder
Soluciones aceptadas (1)
1.129 Vistas
13 Respuestas
Respuestas (13)

maxim_k
Consultant
Consultant

Hi @arnasvel ,

 

Definitely - you need AutoLISP routine.

Do you have full AutoCAD version? Can you use AutoLISP?

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Me gusta

arnasvel
Participant
Participant

Yes I have full Autocad and AUTOLisp plugin.

0 Me gusta

maxim_k
Consultant
Consultant

@arnasvel ,

 

Can you share drawing with at least one block you want auto-number inserted?

I prepared simple rough AutoLISP routine, but I need to know the exact TAG name of the attribute you need to populate automatically.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Me gusta

arnasvel
Participant
Participant

Here You go. 

It doesn't matter if it's conifer or decidous tree block. Value in "numeris" have to be from 1 to whatever it takes.

I hope I can understand how to do that. 

0 Me gusta

maxim_k
Consultant
Consultant
Solución aceptada

Hi @arnasvel ,

 

Please find AutoLISP file in the attachment.

You need to load it with APPLOAD command, then you can use new command - BL_NUMBER.

AutoCAD will ask you the number to start with, then it will ask to select objects.

You can select all objects (blocks) in the drawing and hit Return twice - in this case in all blocks that have attribute with tag "NUMERIS" these attributes will be populated with sequential numbering. The numbering will start from the  last inserted block and will end in the first inserted block.

 

You can select blocks one by one until you hit Return on the second prompt "Select objects", in this case the numbering will start with the first selected block and will end with the last selected block.

 

If this routine will help you, all kudos should go >>>>there<<<<

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community

arnasvel
Participant
Participant
Thank You very much!!! Also getting kudos where You showed!
0 Me gusta

arnasvel
Participant
Participant

So okay. You saw my drawing. Attribute value is in. Can I also somehow make that only value visible on drawing and not all. Cause it's easy to to Attdisp > on. But then it show a lot of things I don't need.  Or its depends how block are created?




0 Me gusta

maxim_k
Consultant
Consultant

Hi Arnas,

 

You can make this attribute visible by editing block definition:

- Open tree block in Block Editor, select attribute and uncheck Invisible property in the Properties palette:

 

2023-01-17_10-01-34.png

 

If you need, you can also adjust thee position of this attribute inside block.

- Save block, close Block Editor,

- Use ATTSYNC command to synchronise attribute definition change.

Now this attribute is visible in all block insertions.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community

alina.balkanskaia
Alumni
Alumni

hHello, @arnasvel! Glad to see that you have found the solution here!

Always big thanks to @maxim_k, a fantastic specialist who finds time to share his knowledge!

Alina Balkanskaia
Community Manager
0 Me gusta

limnakhau
Community Visitor
Community Visitor

I'm trying to scale a dynamic block based on the numeric value of an attribute.

I suspect one of these is the right approach:

  • How do we set a Property Lookup Table entry from an Attribute?

  • Or set a Block Properties Table item based on an Attribute?

  • Or set an Attribute value as a global variable https://omegle.onl/?

Specifically, I'd use the annotation scale, which can be easily assigned to an attribute by the CANNOSCALEVALUE system parameter.

0 Me gusta

maxim_k
Consultant
Consultant

Hi @limnakhau ,

 

Can you provide more details about the way you want to scale dynamic block?

Do you want to scale it depending on the value of one of its attributes?

 

Keep in mind that Property Lookup Table and Block Properties Table are not available in AutoCD for Mac.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Me gusta

vincent.cussey
Observer
Observer

HI, 

Many thanks for this post. 
I Have a question ? 
What do you modify in Autolisp if I want to change the value of incrementation ? 

The value of incrementation is a answer of a question ? 

 

Exemple : 
I select many blocks. 
I execute BL_NUMBER
And I had 2 questions : 
Start Number ?  my answer "1"
Offset Number ? My answer "2"
My result is :
First 1
Second 3
three 5
etc...

 

Many Thanks at all 

Vince `

 

 

0 Me gusta

vincent.cussey
Observer
Observer

Hi

I found It

Sorry 

0 Me gusta