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.

Using F3 to repeat Macro - Doesn't work with Symbols

Started by aqua, January 21, 2007, 05:05:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aqua

Designcad 13

If I run the following macro, I cannot press F3 to repeat it.
This is because it contains a symbol.

If I start the macro, and press esc before setting any points,
I am able to run it again using F3 because a symbol was not utilised.

Does anyone know of code that I can add to allow me to use F3 to repeat the function where symbols or blocks are involved.

Note: you will need to edit the code for the file path so it refers to a symbol/drawing on your computer

Regards Frank



'FTM-30/11/2006
sys(470)=1
layer(116)=6
symbolsize = 1

Looper:
SetPoint "Set points for bores, press Esc to end", 1
If Sys(1) < 1 Then
>Regenerate
{
}
end
Endif
Pointval x1 y1 z1 1
sys(3)=116

X2=(symbolsize*5)+x1
>Merge
{
  <PointXYZ [x1,y1,0]
  <PointXYZ [x2,y1,0]
  <Layer 116
  <Filename "C:\Program Files\Aquaflow\Folders\Symbols\bore.dcd"
  <Type 1
  <Scale 0
  <Reference 0
  }
sys(80)=0
Goto Looper

DrollTroll

Hi Frank,

I don't believe there's currently a way to do this.

Maybe we can come up with a sys() function that will allow you to suspend or resume command history while inside a macro. However, this might have undesirable side effects on Undo-ing the results of a macro. I'll try to look into it for Version 18.
25 years with DesignCAD

Lar

Frank, F3 repeats the last command, and since the last command would have been Merge, it will repeat that.

What you can do is use the Command Line. Hit the Space Bar and type in the macro name (make sure it is in the default macro folder and shorten the name, with no spaces, if necessary). After the first time just hit the Space Bar again and press Enter. That will repeat the command. It will remain at the top of the list until you type something else. If you do, it will move down to the 2nd position, so to get at it again hit Space then Down Arrow then Enter. Or you can hit Space, then F4 (or the down arrow) and the list will drop for you to select with the mouse.

Lar

aqua

Lar

you wrote

"Frank, F3 repeats the last command, and since the last command would have been Merge, it will repeat that."

I use F3 all the time with my macros, and when I do, for the majority of them, it repeats the whole macro, not the last command, i.e the last command is the macro, not the last code/command within the macro.

It is only the symbol ones that cause issue.

PRL - To date, the code hasn't been an issue with symbols. It is an issue with images, i.e if you import an image, then edit the original, you need to import the revised image under a different name otherwise it just repeats the first image.