New macro and lots of Qs

Hi,

I like my forest to be a simple outline of arcs as you can see here :
image
It saves ink, too :)

It works like that : draw a smooth poly, load macro, select smooth poly.
The macro makes use of % along, however I noticed that on a closed poly, the part connecting the last point to the first is not part of the % (ie you get 100% at the last point, before closing). It means the last point must be near the first...

I am full of questions too :
1) I would have liked to erase the smooth poly after completing (even tried to make it an option) but cannot managed
I tried to STORE the smooth poly an then ERASE SELECT to no avail. Any hint ?
2) I would also have liked to multipoly the arcs but how to select them in the macro ? Tried SELBC followed by the color #.
3) Is there a mean to access CC variables ? I wanted to store the linewidth to restore it after completing. Tried GV LW LWIDTH. Nope.
4) Arcs seem to respond badly to SHEET EFFECTS. I used the usual White GLOW on text but part of the text dissapeared (and yes, TEXT sheet was over FOREST sheet containing arcs).

Edit : wanted to paste the macro code but the text is cut...

Thanks for any answer or comment,

JdR

Comments

  • edited April 2009
    Here's the macro (part1/2)

    MACRO FBRD
    SELSAVE
    LWIDTH 0;LSTYLE solid;FSTYLE solid
    LAYER VEGETATION
    SHEET FOREST
    GV RV 10
    GV RV ^DEnter step value (10)
    GN CL 81
    GN CL ^DEnter color: (81)
    COLOR CL
    GV LW 3
    GV LW ^DEnter line width: (3)
    GE BDR ^DSelect forest borderline
    IFERR MacroDone
    LWIDTH LW
    GLEN LV BDR
    GV PSTEP 100*RV/LV
    GV PRCV1 0
    GV PRCV2 PSTEP
    :DrawArc
    GP P1 % PRCV1 BDR
    GP P2 % PRCV2 BDR
    GBRNG BR P1 P2
    ARCB P1 P2 ref P1 <BR-90,0.5*RV
    GV PRCV1 PRCV1+PSTEP
    GV PRCV2 PRCV1+PSTEP
    IFP PRCV1-100 MacroDone
    IFP 100-PRCV2 DrawArc
    GV PRCV2 0
    GO DrawArc
    :MacroDone
    SELREST
    COLOR 0
    ECON
    ENDM

    JdR
  • GV PRCV1 PRCV1+PSTEP
    GV PRCV2 PRCV1+PSTEP
    IFP PRCV1-100 MacroDone
    IFP 100-PRCV2 DrawArc
    GV PRCV2 0
    GO DrawArc
    :MacroDone
    SELREST
    COLOR 0
    ECON
    ENDM


    (part 2/2)

    JdR
  • You might also post this question over at CC2-Macros on Yahoo Groups (groups.yahoo.com). That group is focused on macro writing--you'll probably get a faster and more thorough response. The list is mostly quiet, but rouses itself quickly when new material comes in.
    Steve
  • Thanks sdavies2720, done it.
    But no quicks arousal though...

    JdR
  • Simon RogersSimon Rogers Administrator, ProFantasy Traveler
    Set up a te
    Posted By: Joachim de RavenbelHi,


    It works like that : draw a smooth poly, load macro, select smooth poly.
    The macro makes use of % along, however I noticed that on a closed poly, the part connecting the last point to the first is not part of the % (ie you get 100% at the last point, before closing). It means the last point must be near the first...

    I am full of questions too :
    1) I would have liked to erase the smooth poly after completing (even tried to make it an option) but cannot managed
    I tried to STORE the smooth poly an then ERASE SELECT to no avail. Any hint ?
    Set up a temporary layer in the drawing after SELSAVE using GOLAYER. If you are confident the layer exists in the drawing, you don't need to do this. Draw the entity, do
    SELBYL
    CHANGEL Temporary

    At the end do
    SLEBYL
    ERASE Temporary

    2) I would also have liked to multipoly the arcs but how to select them in the macro ? Tried SELBC followed by the color #.
    Do the layer method, above.

    3) Is there a mean to access CC variables ? I wanted to store the linewidth to restore it after completing. Tried GV LW LWIDTH. Nope.
    SELSAVE with save these settings, SELREST will get them back.

    4) Arcs seem to respond badly to SHEET EFFECTS. I used the usual White GLOW on text but part of the text dissapeared (and yes, TEXT sheet was over FOREST sheet containing arcs).
    I can't reproduce this. I've tried a white glow around arcs, and it looks OK. Point me at the fcw and I'll look.
  • edited April 2009
    Thank you for all those answers. I will give all that a try.

    3) Well, doesn't seem to work with line whidth, colors, fill syles and so on.
    What I would like is to get all those parameters like they were before launching the macro.
    You know, it's only because I'm lazy... and often forget to check the current mode...

    4) Ha ! Cannot reproduce it either ! Everything seems now ok. Computer must have seen I have no hair left !
    However, I made some modification since those troubles, added white smooth polygons under the text and now even with those hidden, everything's ok !
    Perhaps the only thing I had to do was closing CC and opening again...

    JdR
  • Simon RogersSimon Rogers Administrator, ProFantasy Traveler
    Posted By: Joachim de RavenbelThank you for all those answers. I will give all that a try.

    3) Well, doesn't seem to work with line whidth, colors, fill syles and so on.
    What I would like is to get all those parameters like they were before launching the macro.
    You know, it's only because I'm lazy... and often forget to check the current mode...
    JdR
    There is a sneaky way to do this. Place a point on the temp layer you've set up, perhaps at -10000,-10000. When you have finished the macro, but before erasing the layer do
    SKEEP -10000,10000
    and it will extract the settings from the point.
  • I think that SELSAVE and SELREST works as well but haven't tried all parameters yet. I'll tell you later.

    By the way, is there a way to create arrayed variables such as P[1], P[2]... in a macro ?

    Thanks,
    JdR
  • Simon RogersSimon Rogers Administrator, ProFantasy Traveler
    Posted By: Joachim de RavenbelI think that SELSAVE and SELREST works as well but haven't tried all parameters yet. I'll tell you later.

    By the way, is there a way to create arrayed variables such as P[1], P[2]... in a macro ?

    Thanks,
    JdR
    I seem to remember there is an amazingly convulted way of doing this I expermented with when doing a command which built a series of points, but I can't find the details. You aren't really making an array, just a series of variables with numbers at the end. It involves the use of the APND command. This command combines strings together. You can use it build a command.

    So, you use append to attach the variable letter to the number, something like this:

    MACRO ARRAY
    GN index 1
    :arrayloop
    GW temparray A
    APND temparray index
    GW currentarray temparray
    GV temp ^Dnumber?
    IFERR endlable
    GL comm GV
    APND comm
    APND comm currentarray
    APND comm
    APND comm temp
    comm
    GN index index+1
    GO arrayloop
    :endlable
    ENDM

    Note there is a space after each APND comm line. It works like this:
    temparray is the array letter, index the number.
    APND temparray index
    Concatenates the number and letter (eg A1)
    GW currentarray temparray
    assigns the name of the current array variable to currentarray

    GL comm GV
    APND comm
    APND comm currentarray
    APND comm
    APND comm temp

    This lot builds up a command, comm, which looks like this
    GV A1 temp

    comm

    runs that command. Don't build up commands with the ^D sequence - grab that data directly.
  • Thanks ! Using text as command was something I though was impossible...

    Opens new ways...

    Thanks for all your feedbacks,

    JdR
  • edited April 2009
    Posted By: Simon RogersNote there is a space after each APND comm line
    It's more subtile...
    You must only add a space if you add real text, not if you add a variable... Cost me my last hairs, that...

    For example :

    GL comm TEXTM
    APND comm_ ->space needed
    APND comm LifeIsGood_ ->space needed
    APND comm_
    APND comm varPoint ->no space

    if instead APND comm varPoint_ -> with space.
    will yield : TEXTM LifeIsGood varPoint

    APND comm ;_ didn't work though. Wonder, wonder...

    Gave me a lot to think about...

    JdR
  • Simon RogersSimon Rogers Administrator, ProFantasy Traveler
    Posted By: Joachim de RavenbelAPND comm ;_ didn't work though. Wonder, wonder...
    The macro language was never originally envisaged to be able to do this sort of stuff, so we are pushing it horribly.
Sign In or Register to comment.