.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Best way for looking all stat attribut on Dynamic Visibility

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
AubelecBE
607 Views, 5 Replies

Best way for looking all stat attribut on Dynamic Visibility

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

5 REPLIES 5
Message 2 of 6
hgasty1001
in reply to: AubelecBE
Message 3 of 6
AubelecBE
in reply to: hgasty1001

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.

 

Message 4 of 6
richter
in reply to: AubelecBE

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!

Message 5 of 6
AubelecBE
in reply to: richter

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.

 

 

 

Message 6 of 6
AubelecBE
in reply to: AubelecBE

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.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost