BOM Customization

Discussion in 'AutoCAD' started by SARCZAR, Jul 20, 2004.

  1. SARCZAR

    SARCZAR Guest

    I want to create a generic drawing for different drawer sizes. What I want to do is to create a template drawing and then have that prompt you for the length, width, and thickness variable for each piece and then have that fill out our BOM on the drawing. I know this is possible but can someone who know nothing about lisps, vba, etc... figure out how to do that. and if so what's the best way to start. Thanks for any help
     
    SARCZAR, Jul 20, 2004
    #1
  2. SARCZAR

    ECCAD Guest

    <<can someone who know nothing about lisps, vba, etc... figure out how to do that>>

    If you have little knowledge of lisp, vba, etc.. I suggest you start with lisp. It is fairly easy to learn and can do both elements of your sample. To get you stated, study this:

    ;; Make up a block with invisible attributes.
    ;; 1st attribute 'tagname' LENGTH, prompt "Length"
    ;; 2nd attribute 'tagname' WIDTH, prompt "Width"
    ;; 3rd attribute 'tagname' THICK, prompt "Thickness"
    ;; This 'block' will have a 1 inch square vector around it.
    ;; Wblock the 'block' with name "DRAWER"
    ;; Place the 'drawer.dwg' in a support folder.
    ;; Place a 'macro' on your menu .. [Insert Drawer]^c^c(load "drawer")
    ;;
    ;; Next the lisp program..
    ------------------------------------
    ;; Save the program as "drawer.lsp", in your support folder.
    (setvar "ATTREQ" 1)
    (prompt "\n "); blank line feed
    (setq L (getint "\nLength of Drawer ?"))
    (setq W (getint "\nWidth of Drawer ?"))
    (setq Th (getint "\nThickness of Drawer ?"))
    (command "_-insert" "drawer" pause L W "" (itoa L)(itoa W)(itoa Th)); insert the drawer block
    (princ)
    ;; end of lisp
    -------------------------------------
    ;;At this time, you can insert the 'generic' drawer, and have it sized. (in 2D)
    ;;
    ;; Next, to populate the BOM list.
    ;; You need a 'block' insert that has the proper attributes to receive
    ;; the data from a lisp program that will check the drawing for all blocks
    ;; named 'DRAWER', pull out the attribute values (assoc 1 ent)..and insert
    ;; the BOM block, and fill it in.
    ;; When you get this done, come back for the BOM Lisp..

    Bob
     
    ECCAD, Jul 20, 2004
    #2
  3. SARCZAR

    SARCZAR Guest

    I know I must being doing something wrong here but...

    When I entered [Insert Drawer]^c^c(load "drawer")

    I get the following:

    command:[Insert unknown command "[Insert". Press F1 for help

    command:Drawer]
    coomand:
    Command:[InsertDrawer]
    Command:
    Command:(Load "Drawer") ; error no function definition: promt

    And then for the lisp I got the following:

    command:_appload drawer/lsp successfully loaded.
    drawer.lsp successfully loaded

    Cammand: : error: no function defintion: PROMT

    Like I had said I'm very new at this and can't more than make a couple custom macros. So if these are obvious oversights on my part please let me know. Thanks for any help you can give
     
    SARCZAR, Jul 21, 2004
    #3
  4. SARCZAR

    ECCAD Guest

    You place the '[Insert Drawer]^c^c(load "drawer")' into your .mns file, re-load the menu and pick it from the screen.
    Example: under POP2 in your .mns file:

    ***POP2
    **FILE
    ID_MnFile [&File]
    ID_New [&New...\tCtrl+N]^C^C_new
    ID_Open [&Open...\tCtrl+O]^C^C_open
    ID_DWG_CLOSE [&Close]^C^C_close

    [Insert Drawer]^c^c(load "drawer")
    ............
    ...........

    Bob
     
    ECCAD, Jul 21, 2004
    #4
  5. SARCZAR

    ECCAD Guest

    Cammand: : error: no function defintion: PROMT
    Is generated from a typo..in the .lsp file, should be:
    prompt .. not promt.
    review line:
    (prompt "\n "); blank line feed

    Bob
     
    ECCAD, Jul 21, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.