Ilogic rule to color my layer based on two first numbers. In drawing.2

Ilogic rule to color my layer based on two first numbers. In drawing.2

Anonymous
Not applicable
528 Views
2 Replies
Message 1 of 3

Ilogic rule to color my layer based on two first numbers. In drawing.2

Anonymous
Not applicable

Hallo,

 

I have already used this rule but it works only on the exact same part name. How can i change this rule to work for me for example "55" String.Left ("string", 2 ).

 

rule i used:

(<!)Dim drawViews As DrawingView
For Each drawViews In ThisApplication.ActiveDocument.ActiveSheet.DrawingViews

occ3 = drawViews.ReferencedDocumentDescriptor.ReferencedDocument.ComponentDefinition.Occurrences.ItemByName("55 02 0201 C:1")

 

Dim newColor3 As Color

newColor3 = ThisApplication.TransientObjects.CreateColor(0,255,255)

 

Dim drawcurves3 As DrawingCurvesEnumerator

drawcurves3 = drawViews.DrawingCurves(occ3)

 

Dim drawCurve3 As DrawingCurve

For Each drawCurve3 In drawcurves3

      drawCurve3.Color() = newColor3

Next

 
Next

 

TNX

 

Lamrini

0 Likes
529 Views
2 Replies
Replies (2)
Message 2 of 3

adam.nagy
Autodesk Support
Autodesk Support

Hi Lamrini,

 

You would just need to iterate through all the components whose name you want to check, then collect them if they meet the requirement.

I wrote a sample for that:

http://adndevblog.typepad.com/manufacturing/2014/03/get-occurrences-whose-name-starts-with-a-certain...

 

I hope this helps.


Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 3

Anonymous
Not applicable

Hello Adam,

 

Can it also work in a drawing file? problem is that I need to unhide specific part based on  their description. And change layer type for example.

I sometimes have 50 parts that I need to manually unhide, it takes forever!

Does VBA, Ilogic or API have a solution for that?

Attached an example.

 

TNX

 

Lamrini.

 

0 Likes