Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get point location from VBA6

Status
Not open for further replies.

666vito

Industrial
Jul 23, 2007
21
0
0
IT
hi

I use solid edge 14 and visual basic 6. At the end of my work I'll open a macro from SE to work with my program

I try to explain my problem. I have an SE assembly file on this file I make a sketch. This sketch is made only of a line. All the

sketch is in a plane, I have a 2-d sketch. I'd like to get the line's start/end point (in whichever sistem of coordinate). At the end I

should be have a matrix or a table make of start/end point. For examble:

Line1 (3,3)-(5,7)

LIne2(5,7)-(8,11)...........................

Start point of second line is end point of first line.......................All points have one coordinate equal for every point ( sketch is in a plane)

I study how interrogate a SE file from visual basic but I can't resolve this problem........

Can you help me? or this is impossible using SE and VB6? Thanks and sorry for my english



 
Replies continue below

Recommended for you

Hi,

this code fragment should work. You must still be within the
sketch and the file must be an assembly one (all quick & dirty):

Private mApp As SolidEdgeFramework.Application
Private mAsm As AssemblyDocument
Private objProf As Profile
Private objLine2d As Line2d
Private dx As Double
'
Private Sub getLineCoord()
Set mApp = GetObject(, "SolidEdge.Application")
Set mAsm = mApp.ActiveDocument
Dim dy As Double
Set objProf = mAsm.ActiveSketch
For Each objLine2d In objProf.Lines2d
Call objLine2d.GetEndPoint(dx, dy)
Call objLine2d.GetStartPoint(dx, dy)
'...
'... your coding here
'...
Next objLine2d
'
Set mAsm = Nothing
Set objProf = Nothing
Set objLine2d = Nothing
Set mApp = Nothing
'
End Sub

dy
 
Status
Not open for further replies.
Back
Top