Hello. (Sr if my english is so....)
I need to iterate all attribut reference of a bloc and check is this attribut is visible on each stat of dynamic visibility
I have already create a collection with all attribute and another collection with all dynamic attribut.
My solution :
For each Stat Dynamic Visibility in ....
Start transaction
Modify Visibility
Commit
start transaction
for each attribut in my block
check if the attribut is visible
next
commit
Next
I dont know, if i don't commit the first time , the dynamic visibility in blockreference has take effect on the attribut.
Here is only for find a best way. Yhe real code i can do it my self.
I dont know if i can start transaction after go in a sub for launche another transaction.
thx
Solved! Go to Solution.
Solved by AubelecBE. Go to Solution.
Hi,
Try this link: http://adndevblog.typepad.com/autocad/2012/05/accessing-visible-entities-in-a-dynamic-block.html
Gaston Nunez
thanks for the link.. but i have a best way. i dont use DLL import.
I have :
create new block reference
insert this in cad
insert attributreference with defaut value in the blockref
for each stat of visibility
for each attribut reference
memorize if is visible
next
next
delete blockref.
It works well. 🙂
If anyone want the code. i can give you.
Hi AubelecBE!
I have a very similar problem with dynamic blocks. Could you please share your code? I would really appreciate it. I have found that it is quite hard to work with dynamic blocks in AutoCAD API. Thank you!
hi so i have modify this function for to integrate in my class so :
check the file for all the code. (Class1).
here the code for the sub
Public Sub EcrireSurLigneDeCommande(ByVal Texte As String) Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument If IsNothing(doc) = False Then doc.Editor.WriteMessage(Texte) doc.Editor.UpdateScreen() End If End Sub
V1.00 - GestionString.vb is a little module for use .split in a best way.
and ClassDef0g_BlocAttribut.vb and ClassDef0g_BlocAttributDyn.vb is a class i use for memorize all stuff i need for a attribut.
Check in class1 the first sub.
You have to translate some TEXT. my acad is in french language so "Visibilité" is in French.
I can explain you if you have a question.
Here a example how i show all information stored in a Collection. Each item of my collection is a definition of attributdefinition and attribut of dynamic .
I show too each stat of visibility for each attributdef.
++
rename the BMP in PDF.