Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 24, 2012, 11:35:02 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
macro problem
Pages:
1
Go Down
« previous
next »
Author
Topic: macro problem (Read 861 times)
0 Members and 1 Guest are viewing this topic.
eyalyossef
Active Member
Offline
Posts: 2
macro problem
«
on:
May 03, 2009, 10:52:42 AM »
Hello .
This program was written in vb , I want to run the program on macro from the Gcode.
the mach3 editor ,does not get it .
I really thanked those who could help repair program.
Function FindIntersection(px11 As Single, py11 As Single, px12 As Single, py12 As Single, px21 As Single, py21 As Single, px22 As Single, py22 As Single) As String
Dim dx1 As Single
Dim dy1 As Single
Dim dx2 As Single
Dim dy2 As Single
Dim t1 As Single
Dim t2 As Single
Dim nUl As Single
On Error GoTo err
dx1 = px12 - px11 ' calulates dx,dy for each point
dy1 = py12 - py11
dx2 = px22 - px21
dy2 = py22 - py21
nUl = (dy1 * dx2 - dx1 * dy2)
t1 = ((px11 - px21) * dy2 + (py21 - py11) * dx2) / nUl
t2 = ((px21 - px11) * dy1 + (py11 - py21) * dx1) / -nUl
nInter_x = px11 + dx1 * t1 'X point
nInter_y = py11 + dy1 * t1 'Y point
FindIntersection = Round(inter_x, 2) & "," & Round(inter_y, 2)
err:
If err.Number = 11 Then Label1.Caption = "parallel lines"
End Function
«
Last Edit: May 03, 2009, 10:55:57 AM by eyalyossef
»
Logged
vmax549
Guest
Re: macro problem
«
Reply #1 on:
May 07, 2009, 08:35:32 AM »
HIYA Eyal, You were close(;-)to getting it running. I just made a couple of changes and it runs.
Function FindIntersection(px11 As Single, py11 As Single, px12 As Single, py12 As Single, px21 As Single, py21 As Single, px22 As Single, py22 As Single) As String ( SHOULD BE all one line)
Dim dx1 As Single
Dim dy1 As Single
Dim dx2 As Single
Dim dy2 As Single
Dim t1 As Single
Dim t2 As Single
Dim nUl As Single
On Error GoTo N2
dx1 = px12 - px11 ' calulates dx,dy for each point
dy1 = py12 - py11
dx2 = px22 - px21
dy2 = py22 - py21
nUl = (dy1 * dx2 - dx1 * dy2)
t1 = ((px11 - px21) * dy2 + (py21 - py11) * dx2) / nUl
t2 = ((px21 - px11) * dy1 + (py11 - py21) * dx1) / -nUl
nInter_x = px11 + dx1 * t1 'X point
nInter_y = py11 + dy1 * t1 'Y point
FindIntersection = Round(inter_x, 2) & "," & Round(inter_y, 2)
N2:
If err.Number = 11 Then Message"parallel lines"
End
(;-) TP
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...