Results 1 to 2 of 2

Thread: Semi-Automatic Layer Generator

  1. #1
    Member
    Join Date
    2002-08
    Posts
    3
    Login to Give a bone
    0

    Default Semi-Automatic Layer Generator

    I am hoping that somebody could help me. I need to make Autocad's "Revcloud" command work a little more intuitively by placing the cloud on the correct layer.

    I would like the routine to work something like this:

    1. Initiate routine which sets current layer to G-ANNO-REVC-?? (The ?? needs to be a prompt for the user to input a number, this number is then placed into the standard layer name in place of the ??).

    2. Once the current layer has been set, the revcloud command is initiated.

    3. Once the Revcloud is completed, I need insert the Delta by setting the current layer to G-ANNO-REVS-?? (The ?? would be the same number as in 1.)

    4. Now insert the Delta (a block of a triangle with an attribute inside of it) the attribute would also need to be the same number as ?? in 1 & 3 (or if necessary it could be prompted to the user again). The Delta block would also have an invisible attribute which prompts the user for a description.

    Any help would be greatly appreciated, even if it is just with the first point, that is what I am having the greatest difficulty with.

    Thanks

  2. #2
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Semi-Automatic Layer Generator

    Try this. No error checking, and was writen on the fly. It should point you in the right direction.

    Code:
    (defun c:MyRev ( / RevNum OldLay OldAttReq OldAttDia)
    
    (setq RevNum (getstring "\n Enter layer number: "))
    (command "_.layer" "_m" (strcat "G-ANNO-REVC-" RevNum) "")
    (command "_.layer" "_m" (strcat "G-ANNO-REVS-" RevNum) "")
    (setq OldLay (getvar "clayer"))
    (setq OldAttReq (getvar "attreq"))
    (setq OldAttDia (getvar "attdia"))
    (setvar "clayer" (strcat "G-ANNO-REVC-" RevNum))
    (command "_.revcloud")
    (while (> (getvar "cmdactive") 1)
     (command pause)
    )
    (setvar "clayer" (strcat "G-ANNO-REVS-" RevNum))
    (setvar "attdia" 0)
    (setvar "attreq" 1)
    (command "_.insert" EnterYourBlockNameInQuotes pause pause "" pause pause pause)
    (setvar "clayer" OldLay)
    (setvar "attdia" OldAttDia)
    (setvar "attreq" OldAttReq)
    (princ)
    )
    Tim

Similar Threads

  1. 2013: Frame Generator Content Center Edit Update Automatic?
    By whf in forum Inventor - General
    Replies: 1
    Last Post: 2013-05-06, 04:48 PM
  2. Layer Generator VBA Help
    By silvergraphite458961 in forum VBA/COM Interop
    Replies: 6
    Last Post: 2012-07-24, 12:19 PM
  3. NCS/ AIA Layer Name generator?
    By Liamnacuac in forum CAD Standards
    Replies: 0
    Last Post: 2011-11-01, 03:04 PM
  4. Automatic Welds in Frame Generator
    By inventor.wishlist1738 in forum Inventor Wish List
    Replies: 0
    Last Post: 2007-06-01, 03:52 AM

Posting Permissions

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