possibility to include more drawing option in the macro-drawing command

Started by JJG, December 13, 2009, 09:23:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JJG

I think Designcad's developpers should work to give us the possility to include more drawing options in the drawing-command of basicad :

example : when you are drawing in Designcad, you have the possibility to add the snap grid (shurtcut "G"), or orthogonal-mode (shurtcut "H"), or Angle Constraint Mode, or Point Control (shurtcut "J") during the drawing command ; but not possible in basicad during a drawing_command ... why not  ??? 

Bob P

sys(347) hasn't worked for you to switch into ortho mode?
Nor sys(17) to turn on the snap grid?

JJG

Of course yes I known how theeses two sys-functions works, but they can't be used inside a drawing-command :

ex : imagine you draw a line, the two first points given by the code, the other as incomplete, but orthomode ... you must alway write a long macro to do that, using many ways ... it would be easyer whit a code such as :

>line
{
  <LineStyle  ....
  <PointXYZ [Ax, Ay, Az]
  <PointXYZ [Bx, By, Bz]
  <orthomode 1
  <incomplete
}

etc

It's just one (very simple) example !


Bob P

You mean that putting orthomode before the <line command prevents the points from being placed correctly?

paulerens

Do you mean, instead of,  interruptible snap, interruptible with one another macro?

JJG

My first example is may be not good selected ... because it's too much easy to bypass the problem, or rather the lack of possibity of programming such as toggle on or off the snap grid, orthomode, point control, or angle constraint mode during a drawing-command in macro language.

also another example :
I always use the snapgrid before setting the last point with dimension-commande (manualy) : it's a very good an easy way to draw and to implant the dimensions each-other properly, with good and regular spacing out, etc ...(of course I choose previouly a pace of snap grid in connection with dimensions text size, generaly 2x DimensionTextSize ; a macro can do that)
That mean's that I systematically toggle on the snap grid manualy (through shurt cut "G") just before setting the last point of dimension-command, of course during the dimension-command, and I desactive it just after setting the last point.
(I report, in passing, that this "function" concerning dimension automatic each-other spacing out, which lack to Desingcad, works very good in such other cad-program like Autocad, Solidworks etc ...may be Turbocad too ?) OK

But how to do that automatically (snap grid "on" during dimension-command just for setting last point), with a macro ???

That's why, for example, I'm asking for such possibilities.

More generaly, if you want to create dynamicaly "customising" drawing-command, with a little more automation than basics desingcad-drawing-commands, and also with a good prewiew of what you are doing, you'll understand that you need such more possibilities.

Lar

JJG, below is how you would do your 1st example:

'*****MacroStart*****
>OrthoMode
{
}

>Line
{
  '<LineStyle  ....
  <PointXYZ [1,2,3]
  <PointXYZ [4,5,6]
  <incomplete
}

>OrthoMode
{
}
'***MacroEnd***

The trick is to activate OrthoMode before the drawing command. Point commands within basiccad drawing command (PointXYZ, PointRel, etc) are not influenced by the OrthoMode command so ortho isn't used until the command ends. The >Line command ends but because of the <incomplete the line itself is unfinished. This is where the first ortho influences the mouse movements made by the user to complete the line.

The second >OrthoMode turns ortho off.

Lar

paulerens

Hi JJG,
This, may be?
Sys(15)=0
Sys(17)=0
>Origin 'or Getxy
{
}
Sys(15)=1
Regen
>Dimension
{
Sys(17)=1
<Color 255,255,255
  <Layer 200
   <Axis 1
    <Orientation 0
     <Precision 3
      <Pointxyz 0.000 ,0.000 ,0.000
       <incomplete
  }
  Sys(15)=0
  Regen
  End

JJG

Thanks Lar and paulerens for your reply and your interest of this topic.
To Paulerens :
No !!! 

dcadRob

I think that this can be done now with OLE automation. Not as simple as BasicCAD but doable.