News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Question about Sysex Variables

Started by Reddog54, March 10, 2014, 02:49:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Reddog54

Hope I can get some help here.  New to DCAD and BasicCAD both.  have not done any programming in many years but tying to get back into it.  Still learning the commands and syntax so please bear with me.  I have DCAD 3D Max v23

I am trying to write a macro to draw square tubing based on 3 inputs.  They are width, length and thickness.  Using Input [Prompt$] to get the variables I need and  was trying to use the Sysex variable to store the inputs I get. here is the syntax for getting the info:
                       Input [Prompt$], sysex1, sysex2, sysex3  'width, length, thickness of sqtube
                       print "You entered: "
                       print  sysex1, sysex2, sysex3

Printed it back to the screen just to make sure it was entered right and all that is fine.  I can do any numeric function I want to with them except I can not use them to represent X,Y,Z points such as PointXYZ sysex1,sysex2,sysex3.  Why can't I use them this way or rather what can I use, as I need to be able to calculate several different PointXYZ points. I am getting the right information but just not letting me use it the way I want to use it.

Any help and /or suggestions would be appreciated

prl

Quote from: Reddog54 on March 10, 2014, 02:49:25 PM
except I can not use them to represent X,Y,Z points such as PointXYZ sysex1,sysex2,sysex3.  Why can't I use them this way

Reddog,

Post the portion of code where you are using the <pointxyz [sysex1, sysex2, sysex3] parameters.   Should work, example

.
.
.
>Box
{
<color 0, 0, 255
<layer 1
<pointxyz [0, 0, 0]
<pointxyz [sysex1, sysex2, sysex3]
}
.
.
.

Bob P

If you are not going to store the values, why not do it directly like (examples from the help file)

Input "Enter the initial value: ", init

prompt$ = "Enter x and y, separated by commas: "
Input [prompt$], x, y

Message "You entered ", x, " for x and ", y, _
   " for y"

Input "Enter the input file name: ", file$

Open "i", 1, file$

Input "Enter the coordinates: ", x, y, z

Reddog54

here is where i used it.. didn't put it in a [ ] though

>RoundBox
{
  <PointXYZ 0,0,0
  <PointXYZ sysex1,sysex1,sysex2 + 2     'make roundbox 2" longer than needed
  <NFace 8
  <Radius .13             
  }

Reddog54

Putting it in the brackets worked, I just have to work the bugs out now but it is accepting the data at least.

Thank you very much for the help  :)

prl

Quote from: Reddog54 on March 10, 2014, 05:11:33 PM
Thank you very much for the help  :)

Glad to do it.  Have fun and post observations, comments, or questions anytime.

Reddog54

btw Bob, thanks for you suggestion as well.  I understand what you are saying and probably would work for my application as I do not need the data after the macro has run.  The Brackets were easier to fix as I already had everything written that way and just had to add the brackets to make it work. Thanks for the input and suggestions

DrollTroll

Also, I feel I must point out that when you use "sysex1" as a variable, that's NOT an extended system variable -- it's just a temporary variable in the macro. To store the values to disk (which is the purpos of the extended sv's), use "Sysex(1)" -- put the number in parentheses. Same goes for "SysEx$(1)" to store a string value.
25 years with DesignCAD

Reddog54

That is good to know, but as I said before I just needed something temporary to use in the macro and I think Bob's and Prl's suggestions would both accomplish that.  I went with Prl's because that is the way I already had it written and just needed to add the brackets, but it is nice to know what is necessary to accomplish a more permanent storage of values.