Author Topic: vb and C#  (Read 54211 times)

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9081
    • View Profile
Re: vb and C#
« Reply #30 on: June 29, 2017, 00:47:10 am »
Yeah... unless he's willing to "open up", I think I am too. 

And I HATE that!  We try to help, then folks won't let us!

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline BR52

  • Wookie
  • ****
  • Posts: 368
    • View Profile
Re: vb and C#
« Reply #31 on: June 29, 2017, 04:01:02 am »
Hello Alderanuri,

One thing I get angry and hate is people who creates software and rents out per month.
The person are restricted!
I know you want to be free from these people.

http://www.mozaiksoftware.com/products/mozaik-cnc

   Armando

Offline Alderanuri

  • Ewok
  • *
  • Posts: 24
    • View Profile
draw rectangle
« Reply #32 on: June 29, 2017, 19:35:47 pm »
hi
how to draw rectangle
and selected tool

visual studio code_?

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9081
    • View Profile
Re: vb and C#
« Reply #33 on: June 29, 2017, 19:56:10 pm »
<sigh>... Alderan (???), just select the rectangle tool, click one corner, drag, then click the other.  You can size it with the cursor, and correct the size and origin to your likes in the drawing item's description!

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: vb and C#
« Reply #34 on: June 29, 2017, 20:01:07 pm »
In VB

Code: [Select]
sub main
   
        Dim pr As PolyRectangle = New PolyRectangle()

        pr.CornerRadius = 0
        pr.Width = 100
        pr.Height = 50
        pr.Closed = True
        pr.Update()

        CamBamUI.MainUI.ActiveView.CADFile.Add(pr)

end sub

Offline Alderanuri

  • Ewok
  • *
  • Posts: 24
    • View Profile
Re: vb and C#
« Reply #35 on: June 29, 2017, 20:33:14 pm »
Attribute VB_Name = "Model001"
Public Sub Model_001()

App.New

Dim drw As Drawing
Set drw = App.ActiveDrawing

Dim Ty As MillData
Set Ty = App.CreateMillData

heigth = 800
width  = 450



Dim Rectangle As Path
Set Rectangle = drw.CreateRectangle(0, 0, width, heigth)
Rectangle.Fillet (5)


    App.SelectTool T1

   
        Rectangle.Selected = True
   
   
    With Ty
    .ToolNumber = 1
    .OffsetNumber = 1
    .SpindleSpeed = 18000
    .DownFeed = 3000
    .CutFeed = 8000
    .SafeRapidLevel = 30
    .RapidDownTo = 30
    .MaterialTop = 0
    .Stock = 0
    .FinalDepth = -5
    .NumberOfCuts = 1
    .McComp = acamCompTOOLCEN
    .XYCorners = acamCornersSTRAIGHT
    .WidthOfCut = 1
    End With
 
    Ty.RoughFinish

Rectangle.Selected = Fale

End Sub

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: vb and C#
« Reply #36 on: June 29, 2017, 20:47:03 pm »
That does not looks like a Cambam code  ???

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9081
    • View Profile
Re: vb and C#
« Reply #37 on: June 29, 2017, 20:47:12 pm »
AH!  Terrific!  We're progressing.

Now... we'll have to know a FEW things about your machine, but most of that is pretty clear.  All you (seem to) want is a CB script that will draw a rectangle for you!

To be true, you don't NEED a script to do that, because CB has a very versatile rectangle ability.  And there are even plugins to improve it.

But if you want a script to draw rectangles in CB, there are already examples, and we CAN help you.

Thanks Alderan... now it begins to make sense to me.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9081
    • View Profile
Re: vb and C#
« Reply #38 on: June 29, 2017, 20:48:21 pm »
Oh, David, that's NOT CB code, that's code for his existing CAM.  He wants to do the same thing in CB!

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: vb and C#
« Reply #39 on: June 29, 2017, 20:54:36 pm »
Ah ! ok  ::)

So the code for a rectangle is in the previous message, and for the rest, I assume it's a machining operation that is added.

there is a document about how to create a new MOP here. (Vb and Python)

http://www.cambam.info/ref/script.mop-automate

++
David


Offline Alderanuri

  • Ewok
  • *
  • Posts: 24
    • View Profile
Re: vb and C#
« Reply #40 on: June 29, 2017, 20:56:17 pm »
Now I expect samples from you

Offline Alderanuri

  • Ewok
  • *
  • Posts: 24
    • View Profile
Re: vb and C#
« Reply #41 on: June 29, 2017, 20:58:32 pm »
Sub Main
   
        Dim pr As poliRectangle = New PolyRectangle ()

        pr.CornerRadius = 0
        pr.Width = 100
        pr.Height = 50
        pr.Closed = True
        pr.Update ()

        CamBamUI.MainUI.ActiveView.CADFile.Add (pr)

end sub




tool selected ?
« Last Edit: June 29, 2017, 21:02:09 pm by Alderanuri »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: vb and C#
« Reply #42 on: June 29, 2017, 21:11:07 pm »
I never creates code myself that creates machining operation (MOP) so I can't help about that, but certainly you can find infos by reading the source code of plugins that creates MOP.

There is no doc about programing for CB, so the only way is to explore the source code that users share on this forum  and to explore the cambam .dll with a tool like Reflector, ILspy, or the visual studio facilities ; it's what I do (I'm a noob coder)

++
David

Offline Alderanuri

  • Ewok
  • *
  • Posts: 24
    • View Profile
Re: vb and C#
« Reply #43 on: June 30, 2017, 20:29:11 pm »
No progress
Sample and API incompleteness

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: vb and C#
« Reply #44 on: June 30, 2017, 20:40:03 pm »
No progress
Sample and API incompleteness

The API is incomplete, that is correct and that will not change any time soon.
No progress because you have to look at the code examples of plugins here; http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/plugin_menu.html
and work it out for yourself, that is what everyone else had to do.

Now paste this reply into here; http://imtranslator.net/translation/english/to-turkish/translation/
« Last Edit: June 30, 2017, 20:43:06 pm by EddyCurrent »
Filmed in Supermarionation