AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA connector block terminal references

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
jdpeterson2014
437 Views, 2 Replies

VBA connector block terminal references

I have an example connector, Conn1, created with the connector parametric tool. Inside are two terminals with attributes of TERMO1P = 1, TERM02P = 2. The descriptions are TERMDESC01P = "OldDescription1" and TERMDESC02P = "OldDescription2".

 

Through VBA, how do I change the description TERMDESC01P = "NewDescription1"? I found out how to read the attribute name, (TERMDESC01P) using the AcadBlockReference object, but not how to change the associated attribute value.

 

 

Labels (1)
  • VBA
2 REPLIES 2
Message 2 of 3

I was doing two things wrong:

1. I found out one uses obj.TextString = "NewDescription1".

2. Be sure to use the correct indexing:

 

               For i = LBound(AttList) To UBound(AttList)
                    SearchString = AttList(i).TagString
                    If SearchString Like "TERMDESC*P" Then
                        AttList(i).TextString = ListBox2.List(AttStrCntr, 1)
                        AttStrCntr = AttStrCntr + 1
                     End If
               Next
 

Message 3 of 3

Hello @jdpeterson2014 !

 

Great to see you om Community forums.

Are you aware of existing VBA forum? I think it will be useful for you for future cases.

Don't hesitate to check by link and create new threads there.

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



Лена Талхина/Lena Talkhina
Менеджер Сообщества - Русский/Community Manager - Russian

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

Post to forums  

Technology Administrators


AutoCAD Beta