iLogic : Restore drawing curves as standard layer

iLogic : Restore drawing curves as standard layer

fsanchou
Advocate Advocate
709 Views
5 Replies
Message 1 of 6

iLogic : Restore drawing curves as standard layer

fsanchou
Advocate
Advocate

Hi,

 

 

 

Manually, I select by Right clic on Component in Browser > Select As Edges. Then in Annotate Ruban > Format > Layer, I select By standard.

 

Is it possible to restore all drawing curves as standard layer with iLogic?

 

Thanks,

0 Likes
710 Views
5 Replies
Replies (5)
Message 2 of 6

fsanchou
Advocate
Advocate

Anybody ? Maybe somebody from Autodesk?

 

Thanks

0 Likes
Message 3 of 6

fsanchou
Advocate
Advocate

Hi,

 

I hope that Autodesk Answer Day will help me.
Do you have a solution?
 
Thanks.
0 Likes
Message 4 of 6

wayne.brill
Collaborator
Collaborator

Hi,

 

Here is an iLogic rule I worked up. This example changes the layer of the curves in a view. (the example prompts you to select the view)

 

' Select the DrawingView that has the drawing curves 
	' that you want to change to a different layer 
    Dim oDrawingView As DrawingView
    oDrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a drawing view.")
        
    Dim oDrwCurveCollection As ObjectCollection
    oDrwCurveCollection = ThisApplication.TransientObjects.CreateObjectCollection

    Dim oDrwCurve As DrawingCurve
    
	' Get the drawing curves and the segments of the drawing curves
	' and add them to the ObjectCollection
    For Each oDrwCurve In oDrawingView.DrawingCurves
        Dim oDrwCurveSeg As DrawingCurveSegment
        For Each oDrwCurveSeg In oDrwCurve.Segments
         oDrwCurveCollection.Add(oDrwCurveSeg)
        Next oDrwCurveSeg
    Next

    Dim oSheet As Sheet
    oSheet = oDrawingView.Parent
    
	' Get a layer to move the drawing curve segments to
    Dim oLayer As Layer
    'Try one of these layers
	'oLayer = ThisDoc.Document.StylesManager.Layers.Item("Bend Centerline (ANSI)") 
    oLayer = ThisDoc.Document.StylesManager.Layers.Item("Visible (ANSI)")

	
    Call oSheet.ChangeLayer(oDrwCurveCollection, oLayer)

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

Message 5 of 6

fsanchou
Advocate
Advocate

Hi Wayne,

 

I use approximately this method but I need to check each type of segment, and to known the layer name.

Sometimes I have some errors: segment's layer change but not color.

 

Does there is no API feature that reproduce the manual method ?

 

Thanks,

0 Likes
Message 6 of 6

wayne.brill
Collaborator
Collaborator

Hi,

 

In some cases if there is a command that is being run you could execute that command from the API after geting things selected.

 

I do not believe using a command for this is possible. I used the UserInputEvents OnActivateCommand event and I do not see a command being fired when the curves are selected and the ribbon dropdown is used to change the layer.

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

0 Likes