layers and dimensions



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


RE: layers and dimensions



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


        Set objApp = CreateObject("SolidEdge.Application")

    End If

    objApp.Visible = True



    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



'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

Thank you a lot, ErWo!!!!


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