AnsweredAssumed Answered

Can not use api InsertModelAnnotations3 function!

Question asked by Frank Wu Frank Wu on Sep 1, 2017
Latest reply on Sep 4, 2017 by Frank Wu Frank Wu

Hi,Hello everyone!

 

When I use the InsertModelAnnotations3 function to mark dimensions, I can not select the specified Cpmponent.

Can someone help me?

 

my code:

 

Dim swApp As Object

Dim Part As Object

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

 

Sub main()

Set swApp = Application.SldWorks

 

Set Part = swApp.ActiveDoc

boolstatus = Part.ActivateView("Drawing View2")

boolstatus = Part.Extension.SelectByID2("Drawing View2", "DRAWINGVIEW", 0.515566647479853, 0.531855229830506, 0, False, 0, Nothing, 0)

Part.SetPickMode

Part.ClearSelection2 True

boolstatus = Part.Extension.SelectByID2("Drawing View2", "DRAWINGVIEW", 0.490790813744565, 0.534608100245538, 0, True, 0, Nothing, 0)

 

boolstatus = Part.Extension.SelectByID2("handle-SectionAssembly-1-1@/handle-1@handle-SectionAssembly-1/Knob-1@handle", "COMPONENT", 0.354523728200479, 0.504326525682979, 400.008, False, 0, Nothing, 0)

boolstatus = Part.Extension.SelectByID2("handle-SectionAssembly-1-1@/handle-1@handle-SectionAssembly-1/Handle Rod-1@handle", "COMPONENT", 0.335253635295255, 0.43825763572221, 400.008, False, 0, Nothing, 0)

boolstatus = Part.Extension.SelectByID2("handle-SectionAssembly-1-1@/handle-1@handle-SectionAssembly-1/Connector-1@handle", "COMPONENT", 0.942261561809817, 0.434128330099662, 400.003673334144, False, 0, Nothing, 0)

 

Dim vAnnotations As Variant

vAnnotations = Part.InsertModelAnnotations3(2, 32776, False, True, False, True)

End Sub

Attachments

Outcomes