Is it possible to write on the Attrib without having any Block in my DWG?

Is it possible to write on the Attrib without having any Block in my DWG?

sanchezemail
Participant Participant
911 Views
2 Replies
Message 1 of 3

Is it possible to write on the Attrib without having any Block in my DWG?

sanchezemail
Participant
Participant

c #.

I already know how to write from an excel file to blocks with attributes (Following the examples they have kindly posted)

 

But, is it possible to just write to Attributes without having to AttributeCollection from Block? 

or BlockTableRecord?

I don't want  to iterate through each BLOCK in model space (I don't have a BLOCK in my DWG)

How do I make a AttributeCollection that is not method o property from a Block?

c#

Gracias

 

 

 

 

0 Likes
Accepted solutions (2)
912 Views
2 Replies
Replies (2)
Message 2 of 3

Alexander.Rivilis
Mentor
Mentor
Accepted solution

It is impossible as far as owner of AttributeReference (AcDbAttribute) can be only BlockReference (AcDbBlockReference).

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 3 of 3

sanchezemail
Participant
Participant
Accepted solution

I already have the API to write from Excel to AutoCad (Blocks with Attributes), and it works fine.

 

The Client does not want such a big Block (see DWG anexum). But he doesn't want so many Blocks either. 

So, I decided to turn the Attributes into MTexts (no yet). This way he can edit them individually as he wishes.

 

How could I make an Array of the Mtext? Make a loop. 

In this way I will not have to repeat code (IF's) 

 

0 Likes