×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Get point location from VBA6

Get point location from VBA6

Get point location from VBA6

(OP)
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

 

RE: Get point location from VBA6

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

RE: Get point location from VBA6

(OP)
Thanks Donyoung
I'll try your code in next days
by

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources