Jump to content

How to change just on cell type using vla


BLOACH85

Recommended Posts

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~

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...