joshF
Industrial
- Nov 17, 2021
- 3
Looking for help on a auto-Dimension Macro. I have the Auto-Dimension Code, But I'd like to add a feature where I pick the corner (vertex) to be a zero.
Right now it defaults to the bottom/left hand corner. (which is not always ideal)
Can anyone help me with selecting a Vertex in the a drawing view and making this the Zero point for ordinate dimensions?
Right now it defaults to the bottom/left hand corner. (which is not always ideal)
Can anyone help me with selecting a Vertex in the a drawing view and making this the Zero point for ordinate dimensions?
Code:
[indent]Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
'Dim swmodel As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Part.ClearSelection2 True
boolstatus = Part.ActivateSheet("Sheet1")
boolstatus = Part.ActivateView("Drawing View1")
'vertical
boolstatus = Part.Extension.SelectByID2("Drawing View1", "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByRay(0.109400029853413, 0.130434382958623, 6.34999999999764E-03, 0, 0, -1, 1.28866875828181E-03, 1, True, 4, 0)
longstatus = Part.AutoDimension(1, 2, 1, 2, -1)
'Horizontal
boolstatus = Part.Extension.SelectByID2("Drawing View1", "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByRay(8.28686142417286E-02, 0.106556108908108, 6.34999999988395E-03, 0, 0, -1, 1.28866875828181E-03, 1, False, 0, 0)
longstatus = Part.AutoDimension(1, 2, 1, 2, -1)
End Sub[/indent]