• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    File Attachments

    Reply
    *CONSTER

    .LPS help!! please!!

    27 Views, 0 Replies
    06-16-2003 02:45 AM
    please see original post under customization


    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;Tip1566A: DIMNOTE.LSP Dimension Notes (c)1999, Mike Lapinski

    (defun DN_SHOWNOTE (/ LNUM LNOTE)
    (set_tile "error" "")
    (setq LNUM (get_tile "lb_notes")
    LNOTE (nth (atoi LNUM) DM_NOTES)
    ) ;_ end of setq
    (set_tile "eb_note" LNOTE)
    (princ)
    ) ;_ end of defun
    ;;======================================================
    ;; Function: DN_PlaceNote
    ;; Purpose: If valid note is input, close dialog box
    ;;======================================================
    (defun DN_PLACENOTE ()
    (set_tile "error" "")
    (setq DN_MODIFIER (strcase (get_tile "eb_note")))
    (if (= DN_MODIFIER " ")
    (set_tile "error" "Invalid note string")
    (done_dialog 1)
    ) ;_ end of if
    ) ;_ end of defun
    ;;======================================================
    ;; Function: DN_AppendNote
    ;; Purpose: Append note to selected dimension entity
    ;;======================================================
    (defun DN_APPENDDIM (VAL PLACEMENT / ENT DVAL)
    (setq ENT (car (entsel "\nSelect dimension for note: ")))
    (while (/= "DIMENSION" (cdr (assoc 0 (entget ENT))))
    (princ "\nSelected entity is not a DIMENSION.")
    (setq ENT (car (entsel "\nSelect dimension for note: ")))
    ) ;while
    (setq ENT (entget ENT)
    DVAL (cdr (assoc 1 ENT))
    ) ;_ end of setq
    (if (= DVAL "")
    (setq DVAL "<>")
    ) ;_ end of if
    (if (= PLACEMENT 1) ;above line
    (setq VAL (strcat DVAL " " VAL))
    (progn
    (if (wcmatch DVAL "*\\X*")
    (setq VAL (strcat DVAL "\\P" VAL))
    (setq VAL (strcat DVAL "\\X" VAL))
    ) ;_ end of if
    ) ;_ end of progn
    ) ;_ end of if
    (entmod (subst (cons 1 VAL) (assoc 1 ENT) ENT))
    (princ)
    ) ;_ end of defun
    ;;======================================================
    ;; Main Function - Dimension NOTE
    ;;======================================================
    (defun C:smileyvery-happy:NOTE (/ DCL_ID DM_NOTES DN_ABOVE)
    (setq DCL_ID (load_dialog "dimnote.dcl"))
    (if (not (new_dialog "dimnote" DCL_ID))
    (exit)
    ) ;_ end of if
    (setq DM_NOTES '(" LF 4 PVC SDR-35 SEWER"
    " LF 6 PVC SDR-35 SEWER"
    " LF 8 PVC SDR-35 SEWER"
    " LF 10 PVC SDR-35 SEWER"
    " LF 12 PVC SDR-35 SEWER"
    " LF 15 PVC SDR-35 SEWER"
    " LF 18 PVC SDR-35 SEWER"
    " LF 21 PVC SDR-35 SEWER"
    " LF 24 PVC SDR-35 SEWER"

    )
    DN_ABOVE 0
    ) ;_ end of setq
    (set_tile "eb_note" "LF 8 PVC SDR-35 SEWER")
    (set_tile "dn_below" "1") ; Set as default
    (start_list "lb_notes")
    (mapcar 'add_list DM_NOTES)
    (end_list)
    (set_tile "lb_notes" "7")
    (action_tile "lb_notes" "(DN_ShowNote)")
    (action_tile "dn_above" "(setq dn_above 1)")
    (action_tile "dn_below" "(setq dn_above 0)")
    (action_tile "accept" "(DN_PlaceNote)")
    (action_tile "cancel" "(done_dialog 0)")
    (if (eq (start_dialog) 1)
    (DN_APPENDDIM DN_MODIFIER DN_ABOVE)
    ) ;_ end of if
    (unload_dialog DCL_ID)
    (princ)
    ) ;_ end of defun

    (princ "Load by typing DNOTE ")
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;DCL
    //Tip1566B: DIMNOTE.DCL Dimension Notes (c)1999, Mike Lapinski

    dimnote : dialog {
    label = "Dimension Notes";
    initial_focus = eb_note;
    : list_box {
    label = "Notes";
    mnemonic = "o";
    key = "lb_notes";
    height = 11;
    }
    : radio_column {
    fixed_width = true;
    : radio_button {
    label = "Locate Below Dimension";
    mnemonic = "B";
    key = "dn_below";
    }
    : radio_button {
    label = "Locate Next to Dimension";
    mnemonic = "N";
    key = "dn_above";
    }

    }
    : edit_box {
    label = "Note:";
    key = "eb_note";
    horizontal_alignment = left;
    }
    spacer;
    ok_cancel;
    errtile;
    }
    Please use plain text.