Results 1 to 5 of 5

Thread: Diesel macro - Array of holes for making shelf pin holes in cabinets

  1. #1
    Active Member Shinyhead's Avatar
    Join Date
    2006-07
    Location
    Gainesville, FL
    Posts
    84
    Login to Give a bone
    0

    Default Diesel macro - Array of holes for making shelf pin holes in cabinets

    OK, Maybe someone here can help me with this incredibly painful macro.This nasty macro I am working on is close to working, but I think the evaluation sequence is not running correctly and causing the diesel interpeter to error out. I must be missing something and have tried to get quotes to force the eval, but I still keep having it messed up on something.

    The routine makes an array of holes for making shelf pin holes in cabinets, the user clicks the top right corner of the carcass opening and the bottom left corner of the cabinet carcass, it evaluates the ht of the cabinet to determine how far from the top to start (3" if ht<36", 6" if >36"), then figures the width between the column of holes and figures how many rows to make, the spacing is known (32mm).

    Here it is raw, with all quotes removed;

    ^C^C_UCS;NEW;\_setenv;pt1;0,0,0;_ID;\_setenv;pt2;$m=$(getvar,la stpoint);$(IF,$(<,$(-,$(index,1,$(getenv,pt2)),$(index,1,$(getenv,pt1))),-36) ,SETVAR;USERR1;6;,SETVAR;USERR1;3;);USERR2;$(-,$(*,"$(INDEX,0,$(GETENV,PT2)),-1) ,4);USERI1;$(FIX,$(/,$(-,$(*,$(INDEX,1,$(GETENV,PT2)),-1)),$(*,2,$(GETVAR,USERR1 )),1.2598));CIRCLE;-2,-$(getVAR,USERR1);.098425;-ARRAY;L;;R;$(GETVAR,USERI1);2;- 1.2598;-$(GETVAR,USERR2);

    to break it down a bit.

    First it sets the UCS to the upper right hand corner of the cabinet opening and sets the lower left hand corner of the cabinet, making pt1 0,0,0 and making pt2 the lower LH corner.

    ^C^C_UCS;NEW;\_setenv;pt1;0,0,0;_ID;\_setenv;pt2;$m=$(getvar,las tpoint);

    Next we determine the opening ht, and if less then 36" set USERR1 to 3, if greater then 36" it gets set to 6.

    $(IF,$(<,$(-,$(index,1,$(getenv,pt2)),$(index,1,$(getenv,pt1))),-3 6),SETVAR;USERR1;6;,SETVAR;USERR1;3;);

    Next step is to figure the width needed and set it to USERR2

    USERR2;$(-,$(*,"$(INDEX,0,$(GETENV,PT2)),-1),4);

    We then calculate the number of rows (the array has to stop either no less then 3" or 6" from the bottom of the cabinet, depending on the value of USERR1);

    USERI1;$(FIX,$(/,$(-,$(*,$(INDEX,1,$(GETENV,PT2)),-1)),$(*,2,$( GETVAR,USERR1)),1.2598));

    I then make a circle for the array to use;

    CIRCLE;-2,-$(getVAR,USERR1);.098425;

    Then the array itself;

    -ARRAY;L;;R;$(GETVAR,USERI1);2;-1.2598;-$(GETVAR,USERR2);

    Now I have managed to get each element to work, but when stacked into a massive macro, something is losing it in the evaluation sequence, but I cant seem to get my head around where to put the quotes to nest it correctly, anyone have any guidance to making this thing work right. I cannot add too much more to it, as I still have to set ucs back to world at the end and am almost at the character limit for macros.

    Help please.

    Chris M.

  2. #2
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: Diesel macro - Array of holes for making shelf pin holes in cabinets

    Hi Chris

    Please note I have *moved* this thread from the ACAD LT General forum to this one, as I believe it will be better served here.

    Thanks, Mike

    Forum Manager

  3. #3
    Active Member Shinyhead's Avatar
    Join Date
    2006-07
    Location
    Gainesville, FL
    Posts
    84
    Login to Give a bone
    0

    Default Re: Diesel macro - Array of holes for making shelf pin holes in cabinets

    Thanks Mike,
    With LT I can never quite figure out where is best to place it, most people don't customize LT to the level we do, and most folks who use lisp don't have to use diesel enough to help much either so I find myself having to really dig for information on things.

    Chris M.

  4. #4
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Re: Diesel macro - Array of holes for making shelf pin holes in cabinets

    I don't think SETVAR works with diesel does it?

  5. #5
    Active Member Shinyhead's Avatar
    Join Date
    2006-07
    Location
    Gainesville, FL
    Posts
    84
    Login to Give a bone
    0

    Default Re: Diesel macro - Array of holes for making shelf pin holes in cabinets

    Generally its setvar and setenv at the command line and getvar and getenv in diesel to retrieve the values. The user variables are accessed with getvar, most others with getenv. I have also figured out that I simply have too many diesel calls in one routine, there is a maximum time you can call the interpeter, I am trying to get a set number on it, then simplify the routine so that it calls it less then that. Finally going to have some time to re-examine my macro this afternoon.

Similar Threads

  1. 2011: Holes
    By david.brissenden in forum Inventor - General
    Replies: 1
    Last Post: 2011-03-05, 06:26 PM
  2. holes for bolts
    By tsmorris74183347 in forum ACA General
    Replies: 3
    Last Post: 2009-01-12, 08:35 PM
  3. Adjustable shelf for cabinets
    By LanceMcHatton in forum Dynamic Blocks - Sharing
    Replies: 0
    Last Post: 2008-08-26, 09:12 PM
  4. Holes
    By rosterreicher in forum Inventor Wish List
    Replies: 0
    Last Post: 2004-10-12, 12:31 PM
  5. Holes / Holechart Wish
    By rosterreicher in forum Inventor Wish List
    Replies: 0
    Last Post: 2004-06-04, 03:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •