.NET

Reply
Valued Mentor
AubelecBE
Posts: 394
Registered: ‎01-27-2010
Message 1 of 6 (345 Views)
Accepted Solution

Best way for looking all stat attribut on Dynamic Visibility

345 Views, 5 Replies
05-28-2012 11:42 PM

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

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. :smileyhappy:

If anyone want the code. i can give you.

 

Distinguished Mentor
gasty1001
Posts: 576
Registered: ‎04-11-2010
Message 2 of 6 (338 Views)

Re: Best way for looking all stat attribut on Dynamic Visibility

05-29-2012 06:28 AM in reply to: AubelecBE
Valued Mentor
AubelecBE
Posts: 394
Registered: ‎01-27-2010
Message 3 of 6 (331 Views)

Re: Best way for looking all stat attribut on Dynamic Visibility

05-29-2012 08:25 AM in reply to: gasty1001

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. :smileyhappy:

If anyone want the code. i can give you.

 

New Member
richter
Posts: 2
Registered: ‎02-16-2010
Message 4 of 6 (290 Views)

Re: Best way for looking all stat attribut on Dynamic Visibility

09-29-2012 10:27 AM 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!

Valued Mentor
AubelecBE
Posts: 394
Registered: ‎01-27-2010
Message 5 of 6 (261 Views)

Re: Best way for looking all stat attribut on Dynamic Visibility

10-01-2012 04:26 AM 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.

 

 

 

Valued Mentor
AubelecBE
Posts: 394
Registered: ‎01-27-2010
Message 6 of 6 (257 Views)

Re: Best way for looking all stat attribut on Dynamic Visibility

10-01-2012 04:42 AM 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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post