BLOACH85 Posted February 18, 2009 Share Posted February 18, 2009 If you have seen this code before dont run away. My question is not that hard. Ok Ive modified the **** out of this code for the last month. If you look at the code i have trhe rtos set @ 3 8 this is because i get a more precise calculation. my problem is that the first info or data cell comes up in that form of the lunits and luprec is there anyway to set this one cell @ rtos 4 4? I tried the vla-setcelldatatype vla-setcellformat but had little success. Any answers anyone? (defun C:stub (/ col count dis dmz lpc lup pt row row1 strdis tb va vm vo slp) (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 row1 (- row 1)) (setq col 1) (setq slp (getdist "\nWhat is the slope? : ")) (setq dis (/ slp row1)) (setq lup (getvar "lunits")) (setvar "lunits" 4) ; architectural units (setq lpc (getvar "luprec")) (setvar "luprec" 4) ;precision 1/16" (setq dmz (getvar "dimzin")) (setvar "dimzin" 0) ;includes both feet and inches for primary unit (setq strdis (rtos dis 1 ) (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 (vla-settext tb 2 0 dis) (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) ~We are all God's Children~ Quote Link to comment Share on other sites More sharing options...
BLOACH85 Posted February 19, 2009 Author Share Posted February 19, 2009 ok so it all boils down to me wanting the first cell to display in feet and inches and not in decimal form but in keeping the precision that its at so that the numbers are right. Quote Link to comment Share on other sites More sharing options...
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.