Reply

layers and dimensions

[ Edited ]

 

Hi!

I see that in layers tree there is a button "Move Element" which allows me to move dimension to the chosen layer.

Is there any api function in SE which will allow me to move dimension from default layer in Draft document to another layer?

Or is there any other way to hide dimension from drawing view?

 

 

Posted by: P Sh
Post date: 5/31/2010 4:58:49 AM

2 REPLIES

RE: layers and dimensions

[ Edited ]

 

Polina,

This code will do the job;

Public Sub MoveToLayer()

On Error Resume Next

Dim objApp As SolidEdgeFramework.Application

Dim objDoc As SolidEdgeDraft.DraftDocument

Dim objSheet As SolidEdgeDraft.Sheet

Dim objDimensions As SolidEdgeFrameworkSupport.Dimensions

Dim objDimension As SolidEdgeFrameworkSupport.Dimension

Dim strNewLayerName As String

'Get SE

    Set objApp = GetObject(, "SolidEdge.Application")

    If Err  Then

        Err.Clear

        Set objApp = CreateObject("SolidEdge.Application")

    End If

    objApp.Visible = True

 

'Set

    Set objDoc = objApp.ActiveDocument

    Set objVariables = objDoc.Variables

 

    Set objSheet = objDoc.ActiveSheet

    Set objDrawingViews = objSheet.DrawingViews

 

    Set objDimensions = objSheet.Dimensions

    '

    strNewLayerName = "Other Layer"

    For Each objDimension In objDimensions

        objDimension.Layer = strNewLayerName

    Next

 

'Release objects

    Set objApp = Nothing

    Set objDoc = Nothing

    Set objSheet = Nothing

 

    Set objDimensions = Nothing

    Set objDimension = Nothing

End Sub

 

Posted by: Wouter Sloof
Post date: 5/31/2010 8:53:19 PM

RE: layers and dimensions

[ Edited ]

Thank you a lot, ErWo!!!!

 

Posted by: P Sh
Post date: 6/1/2010 2:58:42 AM