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:

AnMastercam

Verified Members
  • Posts

    18
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

AnMastercam's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. BOUNDING BOX USING API- MASTERCAM 2018 Sir, I need your help with the bounding box problem. I didn't see it until recently Firstly , I selected all the geometry present in the part file and drew a bounding a box around it. When I checked it manually , the dimensions of the entity were not displayed on the bounding dialog box. I did the facing operation manually and the toolpath formed looked great, but when I simulated it the facing operation went awry. I've attached 3 screenshots for your understanding I need your help with this Sir. Thanks in advance Bounding Box: # Selecting all entities in the current mastercam file Private Sub SelectGeometry_Click(sender As Object, e As EventArgs) Handles SelectGeometry.Click DialogManager.YesNo("Selecting geometry", "Please select the geometry") SelectionManager.SelectGeometryByMask(QuickMaskType.Solids) End Sub # Button for drawing the bounding box around the block Private Sub Boundingbox_Click(sender As Object, e As EventArgs) Handles Boundingbox.Click Dim view As Geometry() view = BB() End Sub # Rectangular bounding box function Public Function BB() As Geometry() SettingsManager.LineStyle = LineStyleType.Phantom Dim commondata As BoundingBoxCommonParams commondata.CreateLinesArcs = True Dim rectangledata As BoundingBoxRectangularParams rectangledata.ExpandXPlus = NumericUpDown1.Value rectangledata.ExpandXMinus = NumericUpDown2.Value rectangledata.ExpandYPlus = NumericUpDown3.Value rectangledata.ExpandYMinus = NumericUpDown4.Value rectangledata.ExpandZPlus = NumericUpDown5.Value rectangledata.ExpandZMinus = NumericUpDown6.Value Dim geometrymask As GeometryMask geometrymask.Solids = True Dim Geometrytobound As Geometry() = SearchManager.GetGeometry(geometrymask) GeometryCreationManager.RectangularBoundingBox(commondata, rectangledata, Geometrytobound) Return Geometrytobound End Function
  2. TO CHAIN 3D GEOMETRY Public Class Mainview2 Public geometrymask As GeometryMask #CODE FOR SELECTING THE 3DGEOMETRY FOR CREATING A BOUNDING BOX Private Sub SelectGeometry_Click(sender As Object, e As EventArgs) Handles SelectGeometry.Click DialogManager.YesNo("Selecting geometry", "Please select the geometry") SelectionManager.SelectGeometryByMask(QuickMaskType.Solids) End Sub #CODE FOR BOUNDING BOX Private Sub Boundingbox_Click(sender As Object, e As EventArgs) Handles Boundingbox.Click geometrymask.Solids = True Dim geometrytobound As Geometry() = SearchManager.GetGeometry(geometrymask) SettingsManager.LineStyle = LineStyleType.Phantom Dim commondata As BoundingBoxCommonParams commondata.CreateLinesArcs = True Dim rectangledata As BoundingBoxRectangularParams rectangledata.ExpandXPlus = NumericUpDown1.Value rectangledata.ExpandXMinus = NumericUpDown2.Value rectangledata.ExpandYPlus = NumericUpDown3.Value rectangledata.ExpandYMinus = NumericUpDown4.Value rectangledata.ExpandZPlus = NumericUpDown5.Value rectangledata.ExpandZMinus = NumericUpDown6.Value GeometryCreationManager.RectangularBoundingBox(commondata, rectangledata, geometrytobound) "Chain geometry code" Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Chainmanager.getmultiplechains("Selectchains") End Sub Sir, I need your help with this: When I run the chainmanager. A dialog box opens which asks the user to select 2D chains, but the 3D solid chain is disabled. I perused through ("Mastercam.Database.Types"--- Enumeration---"solidtype") and found that it has all the requisite enums I needa for the 3D chaining operation. But I don't know how to pass the "solidtype" enum inside a code. Sir, I have attached a screen shot, Its the 3D chaining option I am having trouble with. Can you please help? Thanks in advance
  3. Private Sub Isometric_Click(sender As Object, e As EventArgs) Handles Isometric.Click Dim view As GraphicsViewType = GraphicsViewType.Iso End Sub Sir , I am facing troubles with enumerations. I am trying to call enums from "graphicviewtype" enumerations but nothing worked. Is something wrong with my code?. Can you please help? Thanks in advance
  4. Sir, Thanks a lot for helping me with the UI earlier. Sir, I am having trouble with generating a bounding box .I know the syntax is asking for an array, but don't know what to assign for "Geometry to bound " as geometry() Can I get some help with this? thanks in advance ORIGINAL SYNTAX: Public Shared Function RectangularBoundingBox ( CommonData As BoundingBoxCommonParams, RectangularData As BoundingBoxRectangularParams, GeometryToBound As Geometry() ) As Geometry() MY SYNTAX Public Shared Function RectangularBoundingBox() As Geometry() Dim solid As BoundingBoxCommonParams solid.CreateSolid = True Dim rectangle As BoundingBoxRectangularParams rectangle.ExpandXMinus = 20 rectangle.ExpandXPlus = 10 rectangle.ExpandYMinus = 50 rectangle.ExpandYPlus = 30 rectangle.ExpandZMinus = 0 rectangle.ExpandZPlus = 40 Dim geometrytobound As Geometry() geometrytobound Return End Function
  5. Sir, thanks a lot for your reply on my query on 'translating geometry' Sir, I am having troubles while calling files from mastercam I created dynamic 'button' and an ' open file dialog ' to allow me to open files within mastercam Here's my code #Creating buttons and openfile dialog# <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> Partial Class MainView Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub Private components As System.ComponentModel.IContainer <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.OKButton = New System.Windows.Forms.Button() Me.openfilebutton = New System.Windows.Forms.Button() Me.openfiledialog = New System.Windows.Forms.OpenFileDialog Me.SuspendLayout() ' 'OKButton ' Me.OKButton.Anchor = System.Windows.Forms.AnchorStyles.Right Me.OKButton.Location = New System.Drawing.Point(449, 300) Me.OKButton.Name = "OKButton" Me.OKButton.Size = New System.Drawing.Size(111, 48) Me.OKButton.TabIndex = 14 Me.OKButton.Text = "OK" Me.OKButton.UseVisualStyleBackColor = True ' 'openfilebutton ' Me.openfilebutton.Anchor = System.Windows.Forms.AnchorStyles.Top Me.openfilebutton.Location = New System.Drawing.Point(100, 155) Me.openfilebutton.Name = "openfilebutton" Me.openfilebutton.Size = New System.Drawing.Size(120, 50) Me.openfilebutton.TabIndex = 13 Me.openfilebutton.Text = "Open" ' 'MainView ' Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(669, 377) Me.Controls.Add(Me.OKButton) Me.Controls.Add(Me.openfilebutton) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "MainView" Me.Text = "MainView" Me.ResumeLayout(False) End Sub Private WithEvents OKButton As System.Windows.Forms.Button Private WithEvents openfilebutton As System.Windows.Forms.Button Private WithEvents openfiledialog As System.Windows.Forms.OpenFileDialog # For opening dialog box using open file button I created# Private Sub OKButton_Click(sender As Object, e As EventArgs) Handles OKButton.Click Me.Close() End Sub Private Sub Openfilebutton_Click(sender As Object, e As EventArgs) Handles openfilebutton.Click If openfiledialog.ShowDialog() = DialogResult.OK Then openfiledialog.FileName = "" End If #Main run function# Public Overrides Function Run(ByVal param As Integer) As MCamReturn Using view = New MainView() view.ShowDialog() End Using Return MCamReturn.NoErrors When I run the add-in, 'Main form appears without the buttons', Can you help me with this Thankyou
  6. Sir If I have to give chaining and toolpath geometry for a component using mastercam APIs how should I proceed. Can you give me some guidance on this. I have attached a .mcam file of a component which I want to machine using mastercam APIs. The part is made in 'CATIA' and is imported into mastercam via ".stp" format. Thanks in Advance part x2.mcam
  7. Translation of a point or line Sir I've been trying to translate a point using the following code Here's my code: Public Overrides Function Run(ByVal param As Integer) As MCamReturn Dim newpoint=translatepoint() Return MCamReturn.NoErrors Private function translatepoint() as boolean Dim firstpoint=New pointgeometry(newpoint3D(0,0,0)) Dim transpoint=New point3D(15,25,30)) Dim Fromview as MC view Dim Toview as MC view return transpoint.translate(firstpoint,transpoint,fromview:=,Toview:=) I don't know what variable to assign to the arguments in return statement Does MC view ask for machine coordinates?
  8. Sir, I am using mastercam 2018. Iam truly Sorry for any inconvenience, I'll post my issues via code hereafter. Thanks for your reply
  9. Thanks sir, The spline geometry worked Sir, Iam unable to understand that MC view on "mirror method using MC views and line 3D" . I have written (1): Line to be mirrored (2): Axis on which the line is mirrored (3): New mirrored line which is the first line coordinates and return the new mirrored line (4): Call the function to the main run program The code shows no error but, its not displaying the mirrored line
  10. Sir, Thank for your reply In the screenshot I attached, "spline" is highlighted in red saying "Declaration expected". But I declared spline as a "spline geometry" , why is it not taking that declare statement
  11. To draw splines using 3 points I have been trying to run a spline command on vb. The code throws the following error. The second screen shot with the namespaces, the white color dims saying namespace unnecessary(Is it due to missing of some .dll files?)
  12. Thanks a lot, Thanks a lot!!! Roger Martin Your instructions worked Thank you

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