TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Register
 
The purpose of these forums is to discuss TurboCAD.  Please keep the discussion of other products to compatibility issues or how the other software’s can be used with TurboCAD.


Macro Palette
Read 355 times
* April 20, 2017, 10:19:12 AM
No idea if anyone uses the Macro Palette, anyway, I needed to  create lots of concentric circles, I couldn't decide the best tool to use so used the macro recorded to record a single alteration as seen below.
Start "Edit|Select"
      Drag xOrigin + 1268.5349766673933000, yOrigin + 241.8858788353384500, zOrigin + 0.0000000000000000, 0
      ChangeEditField 4, "3mm"
      Drag xOrigin + 1268.5349766673933000, yOrigin + 241.8858788353384500, zOrigin + 0.0000000000000000, 0
      ChangeEditField 4, "31mm"
      Drag xOrigin + 1268.5349766673933000, yOrigin + 241.8858788353384500, zOrigin + 0.0000000000000000, 0
      ChangeEditField 5, "3mm"
      Drag xOrigin + 1268.5349766673933000, yOrigin + 241.8858788353384500, zOrigin + 0.0000000000000000, 0
      ChangeEditField 5, "31mm"

Then with a slight modification to the code
 
For I = 31 to 181 step 2
temp = I & " mm"
   Start "Edit|Select"
      Drag xOrigin + 1226.7351720312176000, yOrigin + 195.9666514229270400, zOrigin + 0.0000000000000000, 0
      ChangeEditField 4, temp
      Drag xOrigin + 1226.7351720312176000, yOrigin + 195.9666514229270400, zOrigin + 0.0000000000000000, 0
      ChangeEditField 5, temp
      EnterKey
Next

Selected object, turned on the make copy tool, ran the macro and got all the circles (75 of them)

Just posting in case any new users are unaware of the Macro Recorder
« Last Edit: April 20, 2017, 10:21:06 AM by Andy H »

Logged


April 22, 2017, 02:55:16 AM
#1
That is interesting information.

Thank you.


Jeff


Logged
TC Pro Platinum 2017, 2016 & 2015 (all with LightWorks) & V21
System: i7-5820K @ 3.30GHz, ASRock X99 Extreme4, 16GB DDR4-2133 RAM, Gigabyte GTX 970, Samsung NVMe SSD 950 (256GB), Windows 7 Pro (64-bit) SP1


* April 29, 2017, 06:32:24 PM
#2
Not having done any serious coding since the days of C++ under DOS, may I ask a couple of naive questions, Andy...?

1. What is the significance of the digit that immediately follows "ChangeEditField"? In some of the code it's "4" and sometimes it's "5."

2. What does "EnterKey" do?

Henry H

Logged


* April 30, 2017, 04:58:00 AM
#3
Hi Henry.

1).  The figure after ChangeEditField is the inspection bar field, for example 1 = Scale x, 4 = Size x, etc.  the macro palette can be odd though, using it to record something means one cannot write a macro for distribution (unlike when it was vba), in that if someone didn't have the Scale boxes ticked in the selector properties, it would mean Size x would then be 1 not 4.

2). The EnterKey is the keyboard Enter or Return key press.

For me, the macro recorder is a bit limiting as there is no specific documentation as to how it works, but it can be useful for replicating some tasks, in a similar way the Transform recorder works.   

Logged


* April 30, 2017, 09:31:34 AM
#4
Thanks, Andy.

Henry H

Logged