BLOACH85 Posted January 30, 2009 Posted January 30, 2009 In this lisp The result is right but some picky detailers want to know if they can be stacked. is there a vl function that could be incorporated into this table to do so? (defun C:stt (/ col count dis dmz lpc lup pt row strdis tb va vm vo) (setq pt (vlax-3d-point (getpoint "\nPick Insertion Point: "))) (setq vo (vlax-get-acad-object)) (setq va (vla-get-activedocument vo)) (setq vm (vla-get-modelspace va)) (setq row (+ 1 (getreal "\nHow many Stubs? : "))) (setq col 1) (setq dis (getdist "\nWhat Is The First Stub Dimension? : ")) (setq lup (getvar "lunits")) (setvar "lunits" 5) ; architectural units (setq lpc (getvar "luprec")) (setvar "luprec" 4) ;precision 1/16" (setq dmz (getvar "dimzin")) (setvar "dimzin" 1) ;includes both feet and inches for primary unit (setq strdis (rtos dis 4 4)) (setq tb (vla-addtable vm pt row col 1 1)) (vla-put-titlesuppressed tb :vlax-false) (vla-put-headersuppressed tb :vlax-true) (vla-put-RegenerateTableSuppressed tb :vlax-true) (vla-put-vertcellmargin tb 0.5) (vla-put-horzcellmargin tb 0.5) (vla-setrowheight tb 0 4.5) (vla-setcolumnwidth tb 0 16.1) (vla-settextstyle tb actitlerow "bold") ;title text style (vla-settextstyle tb acdatarow "STANDARD") ;data rows text style (vla-settextheight tb actitlerow 2.5) ;title text height = 0.27 (vla-settextheight tb acdatarow 1.75) ;other cells text height = 0.21 (vla-setalignment tb actitlerow acmiddlecenter) ;title alignment (vla-setalignment tb acdatarow acmiddlecenter) ;data cell alignment (vla-settext tb 0 0 "STUBS") ;title text (setq count 1) (while (< count row) (vla-setrowheight tb count 4.5) (if (= count 1) (progn (vla-settext tb count 0 strdis) (vla-setcellformat tb count 0 "%lu4%pr4"));lu4 - format in architectural units, pr4 - precision is 1/16" (progn (vla-settext tb count 0 (strcat "= A2*" (itoa count)));lu4 - format in architectural units, pr4 - precision is 1/16" (vla-setcellformat tb count 0 "%lu4%pr4") ) ) (setq count (1+ count)) ) (vla-put-RegenerateTableSuppressed tb :vlax-false) (setvar "luprec" lpc) (setvar "lunits" lup) (setvar "dimzin" dmz) (princ) ) ;_ end (vl-load-com) Quote
Lee Mac Posted January 30, 2009 Posted January 30, 2009 AHHHH not the dreaded Table again!! :shock::shock: Quote
MaxwellEdison Posted January 30, 2009 Posted January 30, 2009 Tell the picky detailers that they are more than welcome to modify the code to do so. Quote
BLOACH85 Posted January 30, 2009 Author Posted January 30, 2009 you know that is the fastest that i have got an answer yet. And hey Lee Mac instead of scaling the table automatically it was easier to just set the row height column width and text size to work in a 24 X 36 dwg witch is standard for our stair details so if i have to use a bigger sheet then i will scale it. screw figuring it out. Dude there is no one on this earth that is more tired of looking at this routine than me. Thank everything that is holy that no if they want to fix it they need to learn lisp also!!! And thanks alot Quote
BLOACH85 Posted January 30, 2009 Author Posted January 30, 2009 so how do i incorporate this into the routine to where the fractions are stacked in the table? Quote
Lee Mac Posted January 30, 2009 Posted January 30, 2009 Wrote this as a bit of fun (defun stacknum (num den typ) (cond ((= typ "D") (setq txt (strcat "\{\\H0.7x;\\S" (itoa num) "#" (itoa den) ";\}"))) ((= typ "H") (setq txt (strcat "\{\\H0.7x;\\S" (itoa num) "/" (itoa den) ";\}"))))) (defun c:Fractionizer (/ ss n1 n2 eLst txt ans) (if (and (setq ss (ssget '((0 . "MTEXT")))) (setq n1 (getint "\nSpecify Numerator: ")) (setq n2 (getint "\nSpecify Denominator: "))) (progn (initget 1 "D H") (setq ans (getkword "\nStacked Horizontally or Vertically? [H/D] : ")) (cond ((= ans "H") (stacknum n1 n2 "H")) ((= ans "D") (stacknum n1 n2 "D"))) (setq eLst (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))) (foreach e eLst (entmod (subst (cons 1 txt) (assoc 1 (entget e)) (entget e))))) (princ "\n<!> No Text Selected! <!>")) (princ)) Should give you a clue Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.