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:

Create tool path fail for vb.net


Recommended Posts

With X5 (which is a sunsetted = no longer a supported version), what I can do here is very limited.

A quick look at the code that is run when you click the OK button, shows issues...

1> No geometry is created for the rectangle because the corner points you calculate are both X0,Y,Z0.

        Dim ss As Double
        'If mcUnit = mcUnit Then
            ss = 1 'Uncomment this line and the rectangle will now be created.
                       '*As long as you've entered valid values for the (3) items on your Form!*
        'Else
        '    ss = ss / 25.4
        'End If

        Dim i, j, k As Integer
        
        ' ss = 0 here, so the resulting i,j,k values become 0 !
        ' CreateRectangle fails to create anything because both corner pointsare 0,0,0

        i = (Int(TX.Text) / 2) * ss : j = (Int(TY.Text) / 2) * ss : k = (Int(TZ.Text)) * ss
        Dim topRectangle = GeometryCreationManager.CreateRectangle(New Point3D(i, j, 0), New Point3D(-i, -j, 0))

2> So after you've fixed this issue of no geometry.
     Now that you do have geometry to be chained, you're chaining "selected" geometry.
     But the problem is, you have no "selected" geometry!
              
         Dim chains = ChainManager.ChainAllSelected(True)
         
         'Yyou need to set the geometry entities you're creating as "selected".
         
               With element
                .Color = 12
                .Level = 2
                .Selected = true ' Added so this entity is makred as "selected".
                .Commit()
            End With

Link to comment
Share on other sites

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...