BLOACH85 Posted January 23, 2009 Posted January 23, 2009 Hi, I am a Structual steel draftsman and i am trying to write a routine that will automaticall do stub dimensions by prompting the user for the first dimension but, here is the deal. I need to the cells to be data cells and get the finished product in feet and inches. It all needs to be under a certain layer and it needs to insert to the right size of the drawing (preferably the dimscale!). so can anyone help with this? (DEFUN C:STUBS (/ WIDE COL ROW TB HIGH PT VA VO VM) (SETQ PT (VLAX-3D-POINT (GETPOINT))) (SETQ VO (VLAX-GET-ACAD-OBJECT)) (SETQ VA (VLA-GET-ACTIVEDOCUMENT VO)) (SETQ VM (VLA-GET-MODELSPACE VA)) (SETQ ROW 15) (SETQ COL 1) (SETQ HIGH 0.3875) (SETQ WIDE 1.25) (SETQ TB (VLA-ADDTABLE VM PT ROW COL HIGH WIDE)) (VLA-PUT-REGENERATETABLESUPPRESSED TB :VLAX-FALSE) (vla-settext tb 0 0 "STUBS") (vla-settext tb 1 0 (GETDIST "What is the first stub dimension?")) (vla-settext tb 2 0 "=A2*2") (vla-settext tb 3 0 "=A2*3") (vla-settext tb 4 0 "=A2*4") (vla-settext tb 5 0 "=A2*4") (vla-settext tb 6 0 "=A2*5") (vla-settext tb 7 0 "=A2*6") (vla-settext tb 8 0 "=A2*7") (vla-settext tb 9 0 "=A2*8") (vla-settext tb 10 0 "=A2*9") (vla-settext tb 11 0 "=A2*10") (vla-settext tb 12 0 "=A2*11") (vla-settext tb 13 0 "=A2*12") (vla-settext tb 14 0 "=A2*13") (vla-settext tb 15 0 "=A2*14") ) (vla-put-RegenerateTableSuppressed tb :vlax-false ) (princ) );_ end Quote
BLOACH85 Posted January 23, 2009 Author Posted January 23, 2009 I also need this routine to prompt on how many cells (or stubs) do i want so that i dont have to explode the table if there is less than 15 stubs to delete the excess. i hope this isnt too much trouble but i cant figure it out. (DEFUN C:STUBS (/ WIDE COL ROW TB HIGH PT VA VO VM) (SETQ PT (VLAX-3D-POINT (GETPOINT))) (SETQ VO (VLAX-GET-ACAD-OBJECT)) (SETQ VA (VLA-GET-ACTIVEDOCUMENT VO)) (SETQ VM (VLA-GET-MODELSPACE VA)) (SETQ ROW 15) (SETQ COL 1) (SETQ HIGH 0.3875) (SETQ WIDE 1.25) (SETQ TB (VLA-ADDTABLE VM PT ROW COL HIGH WIDE)) (VLA-PUT-REGENERATETABLESUPPRESSED TB :VLAX-FALSE) (vla-settext tb 0 0 "STUBS") (vla-settext tb 1 0 (GETDIST "What is the first stub dimension?")) (vla-settext tb 2 0 "=A2*2") (vla-settext tb 3 0 "=A2*3") (vla-settext tb 4 0 "=A2*4") (vla-settext tb 5 0 "=A2*4") (vla-settext tb 6 0 "=A2*5") (vla-settext tb 7 0 "=A2*6") (vla-settext tb 8 0 "=A2*7") (vla-settext tb 9 0 "=A2*8") (vla-settext tb 10 0 "=A2*9") (vla-settext tb 11 0 "=A2*10") (vla-settext tb 12 0 "=A2*11") (vla-settext tb 13 0 "=A2*12") (vla-settext tb 14 0 "=A2*13") (vla-settext tb 15 0 "=A2*14") ) (vla-put-RegenerateTableSuppressed tb :vlax-false ) (princ) );_ end Quote
BLOACH85 Posted January 23, 2009 Author Posted January 23, 2009 This will really be helpful in my work for all of our detailers up here so and info will be appreciated but i think i may have stuck my head in a little deep with this one. It works but it has a few kinks. and also, like i said gives the numbers in decimal form. I want feet inches and fraction. under properties the cell type is text so im lost on how to get the cell types to be data. Do i have to (in the lisp file) create a new table style and set it as default? Oh and the layer really doesnt matter because it will insert in whatever layer is current. Please if anyone can guide me through this extreme learnig process please please take this head ache from me. I have lost sleep for 2 nights allready. (P.S. I asked my wife if she knew what to do. Turns out they dont know everything!!!) 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.