Hide Table of Contents

Insert Angular Running Dimension Example (VBA)

This example shows how to insert an angular running dimension and get its properties.

' Preconditions:
' 1. Open install_dir\samples\tutorial\advdrawings\foodprocessor.slddrw.
' 2. Open an Immediate window.
' Postconditions:
' 1. The specified angular running dimension is inserted into the drawing.
' 2. Inspect the Immediate window.
' NOTE: Because the model is used elsewhere, do not save changes to it.
' ---------------------------------------------------------------------------
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim selmgr As SldWorks.SelectionMgr
Dim dispdim As SldWorks.DisplayDimension
Dim boolstatus As Boolean
Dim errstatus as Long

Option Explicit

Sub main()

    Set swApp = Application.SldWorks
    Set Part = swApp.ActiveDoc

    boolstatus = Part.ActivateView("Drawing View1")
    boolstatus = Part.Extension.SelectByID2("", "EDGE", 0.163726736787323, 0.199115091463415, 4.79999999993197E-03, True, 0, Nothing, 0)
    boolstatus = Part.Extension.SelectByID2("", "EDGE", 0.220795425811714, 0.179644597560976, 4.79999999998881E-03, True, 0, Nothing, 0)

    Set dispdim = Part.Extension.AddAngularRunningDim(False, True, True, 0.154288188900673, 7.94194886913027E-02, 0, errstatus)


    boolstatus = Part.Extension.SelectByID2("D2@Sketch31@foodprocessor.SLDDRW", "DIMENSION", 4.08612062995185E-02, 0.166216670731707, 0, False, 0, Nothing, 0)
    Set selmgr = Part.SelectionManager
    Set dispdim = selmgr.GetSelectedObject6(1, -1)

    Debug.Print "Display chained angular dimensions? " & dispdim.DisplayAsChain
    Debug.Print "Run the angular dimensions bidirectionally? " & dispdim.RunBidirectionally
    Debug.Print "Extend extension lines from center of angular running dimension? " & dispdim.ExtensionLineExtendsFromCenterOfSet
Debug.Print "Are extension lines jogged? " & dispdim.Jogged
    Debug.Print "Extension line style same as leader line style? " & dispdim.ExtensionLineSameAsLeaderStyle
    Debug.Print "Extension line uses document settings? " & dispdim.ExtensionLineUseDocumentDisplay

End Sub


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

Subject:   Feedback on Help Topics
Page:   Insert Angular Running Dimension Example (VBA)
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:


We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again

Web Help Content Version: API Help (English only) 2016 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.