AnsweredAssumed Answered

Section line coordinate in drawing view

Question asked by Subhra Maiti on Dec 9, 2014
Latest reply on Dec 10, 2014 by Subhra Maiti

I want to get the section line starting position in drawing doc.

I am using

--------------------------------------------------------------------------------------------------------------------------------------

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

boolstatus = Part.Extension.SelectByID2("Section Line2", "SECTIONLINE", 0, 0, 0, False, 0, Nothing, 0)

Set swFeat = Part.SelectionManager.GetSelectedObject6(1, 0)

Set swSectionLine = swFeat.GetSpecificFeature2

 

v2 = swSectionLine.GetLineInfo

 

Dim v3(0 To 2) As Double

v3(0) = v2(0)

v3(1) = v2(1)

v3(2) = v2(3)

 

v4 = v3

 

Dim swMathUtils As SldWorks.MathUtility

Dim swXform As SldWorks.MathTransform

Dim swMathPt As SldWorks.MathPoint

Set swMathUtils = swApp.GetMathUtility

Set swXform = swView.ModelToViewTransform

Set swMathPt = swMathUtils.CreatePoint(v4)

Set swMathPt = swMathPt.MultiplyTransform(swXform)

 

MsgBox (swMathPt.ArrayData(0) * 1000 & vbCrLf & swMathPt.ArrayData(1) * 1000 & vbCrLf & swMathPt.ArrayData(2) * 1000)

 

---------------------------------------------------------------------------------------------------------------------------------------------

 

Its gives me wrong result. What is wrong? Please help

Outcomes