×
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

AssociativeLine to Line

AssociativeLine to Line

AssociativeLine to Line

(OP)
I am trying to get a line from a passed AssociativeLineBuilder from a Line created in another Sub Routine.  The journal selects the line calling for the name, I am trying to avoid this since I plan on calling this multiple times.  The previous subroutine only uses the builder class, so I do not yet have the feature identified as Line.

Recoded journal code:

CODE

Dim line2 As Line = CType(associativeLine1.FindObject("CURVE 1"), Line)

Here is my code as it currently stands

CODE

   Dim feature1 As Features.Feature
   feature1 = associativeLineBuilder1.commitFeature()
   Dim associativeLine1 As Features.associativeLine = CType(feature1, Features.associativeLine)

   Dim line2 As Line = CType( associativeLine1, Line )

The problem is in defining the line.  I know there should be a way.

Error says: Value of type 'NXOpen.Features.AssociativeLine' cannot be converted to NXOpen.Line

I do not want the program selecting the component by the name, but rather passing the value of the currently created components.

Any help would be appreciated.

RE: AssociativeLine to Line

(OP)
Edit:  The initial journal recording as posted, was not finding the physical line but a feature of that line, I think.  There is a previous entry which finds the external line, which calls associative line to do so, so easily converted.  Now the question is,  What is "Curve 1"  and how do I generalize it so that it will find this object on every line that is run through the code?

Recorded journal code is as follows, more complete:

CODE

Dim associativeLine1 As Features.AssociativeLine = CType(workPart.Features.FindObject("LINE(3)"), Features.AssociativeLine)

Dim line2 As Line = CType(associativeLine1.FindObject("CURVE 1"), Line)

Thanks again for any help.

RE: AssociativeLine to Line

CODE

Dim line2 As Line = associativeLine1.GetEntities(0)

www.nxjournaling.com

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