Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

NetHook 2.0 API: Samples & Examples Available


Recommended Posts

You don't say whether you're using the X3 or X3 samples, so I've assumed the X2...

 

This is what I see in the Errors/Warnings/Messages window in Visual Studio ->

 

quote:

'Mastercam.Database.Types.TranslationMode' is obsolete: 'This enumerated class has been marked as deprecated / obsolete - the Geometry class members bool Translate(Point3D From, Point3D To, short FromViewNumber, short ToViewNumber) and Geometry CopyAndTranslate(Point3D From, Point3D To, short FromViewNumber, short ToViewNumber) should be used instead.'

C:mcamx2-mr2SDKNetHookExamplesNetHook2ExampleVBNetHook2ExampleVB3 - Database3.3 - The Geometry Class.vb 96 30 NetHook2ExampleVB


It is telling me that I should use the Translate and/or CopyTranslate methods instead of the "deprecated/obsolete" TranslationMode.

Link to comment
Share on other sites

X3

 

I saw nothing to distinguish between the two.

 

The only directories in NetHook_2.0_Examples

were BoltCircle_VB, NetHook2ExampleVB and NetHook2Example

 

I'd ask if it matters but apparently it does.

 

So

 

Dim TransMode As TranslationMode = TranslationMode.MoveExisting

 

SHOULD BE?

 

Dim TransMode As Translate = Translate.MoveExisting

 

Will in conflict with dot translate in following statement?

(parameters deleted for clarity)

 

SecondNewLine.Translate(,,,, GraphicsViewNumber)

Link to comment
Share on other sites

dialogdude,

 

1) The TranslationMode enum no longer exists, because there are different methods to take care of the different modes. So instead of writing the following code, like you might have been inclinced to do in X2...

 

code:

Dim TransMode As TranslationMode = TranslationMode.MoveExisting

Dim GraphicsViewNumber As Short = ViewManager.GraphicsView

Dim TranslateFromPoint As Point3D = New Point3D(0.0, 0.0, 0.0)

Dim TranslateToPoint As Point3D = New Point3D(0.0, -0.5, 0.0)

 

SecondNewLine.Translate(TransMode, TranslateFromPoint, TranslateToPoint, GraphicsViewNumber, GraphicsViewNumber)

... you would write this instead...

 

code:

Dim GraphicsViewNumber As Short = ViewManager.GraphicsView

Dim TranslateFromPoint As Point3D = New Point3D(0.0, 0.0, 0.0)

Dim TranslateToPoint As Point3D = New Point3D(0.0, -0.5, 0.0)

 

SecondNewLine.Translate(TranslateFromPoint, TranslateToPoint, GraphicsViewNumber, GraphicsViewNumber)

There's also a sibling method for the old TranslationMode of copying, called 'CopyAndTranslate()'.

 

 

2) If you want it, there's new versions of both the Samples & Examples project and the Reference Guide for X3 up on Mastercam.com in the Support -> Downloads -> Misc section. You've already stumbled across one of the only things that actually changed between X2 and X3 in these Geometry manipulation methods, but if you want the latest and greatest it's up there for you.

Link to comment
Share on other sites
  • 10 months later...
  • 2 months later...
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...