AnsweredAssumed Answered

Drawing Note Macro Help: Calling out part properties in assembly drawing

Question asked by Brett Stainken on Mar 24, 2017
Latest reply on Mar 28, 2017 by Peter Brinkhuis

I am looking for a macro to look into the properties of each part in an assembly, and if the part has a "filter" property with a "yes" in the value/txt expression, to display a note "flow" with an arrow for each part that has a "yes" in the filter property value.

This is as far as I have gotten:

Sub CreateAnote()

    Dim swApp As Object

    Dim Model As Object

    Dim str As String

   

    Const swDocPART = 1

    Const swDocASSEMBLY = 2

    Const swDocDRAWING = 3

   

Set swApp = CreateObject("SldWorks.Application")

Set Model = swApp.ActiveDoc

    If Model Is Nothing Then

        Exit Sub

    End If

    If (Model.GetType <> swDocDRAWING) Then

        swApp.SendMsgToUser ("Only used for drawings")

        Exit Sub

    End If

    str = "Flow>"

    Model.CreateText str, 0.09, 0.08, 0, 0.01, 0

End Sub

 

Thanks for your help

Outcomes