Hide Table of Contents

Insert Angular Running Dimension Example (C#)

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.
// ---------------------------------------------------------------------------

using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using System.Runtime.InteropServices;
using System;
using System.Diagnostics;
namespace AngularRunningDimensions_CSharp.csproj
{
    
partial class SolidWorksMacro
    {

        
public void Main()
        {
            
ModelDoc2 Part = default(ModelDoc2);
            
SelectionMgr selmgr = default(SelectionMgr);
            
DisplayDimension dispdim = default(DisplayDimension);
            
bool boolstatus = false;
            
int intstatus;

            Part = (
ModelDoc2)swApp.ActiveDoc;

            boolstatus = Part.Extension.SelectByID2(
"", "EDGE", 0.163726736787323, 0.199115091463415, 0.00479999999993197, true, 0, null, 0);
            boolstatus = Part.Extension.SelectByID2(
"", "EDGE", 0.220795425811714, 0.179644597560976, 0.00479999999998881, true, 0, null, 0);

            dispdim = Part.Extension.AddAngularRunningDim(
false, true, true, 0.154288188900673, 0.0794194886913027, 0, intstatus);
            Part.Extension.ReJogRunningDimension();
            Part.Extension.AlignRunningDimension();

            Part.SetPickMode();

            boolstatus = Part.Extension.SelectByID2(
"D2@Sketch31@foodprocessor.SLDDRW", "DIMENSION", 0.0408612062995185, 0.166216670731707, 0, false, 0, null, 0);
            selmgr = (
SelectionMgr)Part.SelectionManager;
            dispdim = (
DisplayDimension)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);

        }


        
public SldWorks swApp;

    }
}

 



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

 
*Email:  
Subject:   Feedback on Help Topics
Page:   Insert Angular Running Dimension Example (C#)
*Comment:  
*   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:



x

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
x

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.