Hide Table of Contents

Create Compound Note Example (VBA)

This example shows how to create a compound note in a drawing document.

 

'---------------------------------------------

Dim swApp As Object

Dim drawing As Object

Dim note As Object

 

Sub main()

Set swApp = CreateObject ("SldWorks.Application")

 

' Get open drawing document

Set drawing = swApp.ActiveDoc  

 

' You can have an entity selected in a drawing view if you want an attached note

' Call subfunction to create the compound note

makeCnote

 

End Sub

 

sub makeCnote()

set note = drawing.CreateCompoundNote (0.00635, 0.05, 0.2, 0.0)

 ' Add text to note

 note.AddText "zero pt", 0, 0, 0  

 note.AddText "top", 0.01, 0.01, 0

 

 ' Prepare note for geometry

 note.BeginSketchEdit    

 

 ' Add geometry to note

 drawing.CreateLineVB 0, 0, 0, 0.01, 0.01, 0

 drawing.CreateCircleVB 0, 0, 0, 0.01414

 

 ' Finish

 note.EndSketchEdit    

 

' Do some queries also

If (note.IsCompoundNote()) Then    

' If object is compound note

count = note.GetTextCount()   

' Determine # of text entities

n2 = note.GetTextAtIndex (2)   

' Get the 2nd piece of text

n1 = note.GetTextAtIndex (1)   

' Get the 1st piece of text

ht2 = note.GetHeightAtIndex (2)   

' Get height of 2nd piece of text

End if

 

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

 
*Email:  
Subject:   Feedback on Help Topics
Page:   Compound Note Example (VBA)
*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) 2015 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.