Tharwat Posted August 21, 2012 Posted August 21, 2012 Open a new drawing then load the following attached file with the command appload and at the command line call the routine with the name lst2table and just specify a point . lst2table.LSP Quote
fixo Posted August 21, 2012 Posted August 21, 2012 One more from my oldies: (defun C:stbl(/ acsp adoc col header headers hgt line master row table tablelist x) (vl-load-com) (or adoc (setq adoc (vla-get-activedocument (vlax-get-acad-object))) ) (or acsp (setq acsp (vla-get-block (vla-get-activelayout adoc))) ) (setq hgt (getvar "dimtxt")) ;; Here your put your master list, same as in your example ;; (setq master '(bla bla...)()()()) (setq tablelist (mapcar '(lambda(x)(car (mapcar 'cons (list (car x))(cdr x)))) master)) (setq table (vlax-invoke acsp 'addtable (getpoint "\nTable location: ")(+ 2 (length tablelist))(length (car tablelist)) (* hgt 1.5) (* hgt 15))) (vla-put-regeneratetablesuppressed table :vlax-true) (vla-setcelltextheight table 0 0 5) (vla-settext table 0 0 "Stations") (setq headers (list "Distance" "X" "Y" "Z")) (setq col 0) (while (setq header (car headers)) (vla-setcelltextheight table 1 col (* hgt 1.25)) (vla-settext table 1 col header) (setq col ( 1+ col)) (setq headers (cdr headers)) ) (setq row 2) (while (setq line (car tablelist)) (setq col 0) (foreach item line (vla-setcelltextheight table row col (* hgt 1.25)) (vla-settext table row col (rtos item 2 3)) (setq col (1+ col))) (setq row (1+ row)) (setq tablelist (cdr tablelist))) (vla-put-regeneratetablesuppressed table :vlax-false) (princ) ) ~'J'~ Quote
aloy Posted August 21, 2012 Author Posted August 21, 2012 Hi Tharwat, Yes, very nicely done. Do I have the permission to use it for my future projects?. Also how to remove the zeros being generated for Z coordinate by code that generate the list L? Regards, Aloy Quote
aloy Posted August 21, 2012 Author Posted August 21, 2012 Hi Fixo, Yes, it generates the require table; but font size for the tittle is too large. Thanks for replying. Aloy Quote
Tharwat Posted August 22, 2012 Posted August 22, 2012 Hi Tharwat,Yes, very nicely done. Thank you Aloy . Do I have the permission to use it for my future projects?. Also how to remove the zeros being generated for Z coordinate by code that generate the list L? Sure you can use my code but without removing any part of it Aloy . You can remove the Z coordinates by removing the codes related to it , but would you remove the Z column also or just the Z coordinates (contents) ? Tharwat Quote
aloy Posted August 22, 2012 Author Posted August 22, 2012 I am only preparing 2D drawings, therefore no need of z coordinates. The column No.4 is for remaks, which is meant to be for tangent to spiral, spiral to circle, circle to spiral and spiral to tangent. I must find a way to put them at chainages not divisible by 20 in that order when transition curves(spirals) are present in a highway. I will refine these later. Also I need to put the chainages in the standard format. Regards, Aloy Quote
Tharwat Posted August 22, 2012 Posted August 22, 2012 Here it goes without z coordinates in the fourth column . lst2table V0.2.LSP Quote
aloy Posted August 22, 2012 Author Posted August 22, 2012 Tharwat, We need to be able to load the list seperately so that the draftperson can work independantly and list can change from section to section on the road. Also you need to put a variable for cell hight and text hight, just like the polyline code I have modified. I willtry the code you sent later. With Best Regards, Aloy Quote
aloy Posted August 23, 2012 Author Posted August 23, 2012 Hi Tharwat, Yes, it works; nothing in the 4th column. It works with the list L loaded seperately and as expected you name appears in the command window. Regards Aloy Quote
Tharwat Posted August 23, 2012 Posted August 23, 2012 I really very happy that you finally knew how to got it worked . Quote
aloy Posted August 24, 2012 Author Posted August 24, 2012 Tharwat, I have managed to change the polyline code and yours with my Alisp, I will read up Vlisp and deal with similar things soon. Regards, Aloy 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.