student21 Posted January 27, 2015 Share Posted January 27, 2015 Dear Sir, I came across this lisp routines that would let you select each line in a drawing and it would create a line and bearing table. I was able to make small modifications to it, but I could not figure out how to make it use the current text style. Please see link below - - - Any assistance would be much appreciated, Thank you http://www.cadtutor.net/forum/showthread.php?49329-Generate-Bearings-amp-Distances-into-table Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 28, 2015 Share Posted January 28, 2015 This is a bit long but I think what you want is at bottom. ; example of creating a table style (vl-load-com) (defun c:CreateTableStyle() ;; Get the AutoCAD application and current document (setq acad (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acad)) ;; Get the Dictionaries collection and the TableStyle dictionary (setq dicts (vla-get-Dictionaries doc)) (setq dictObj (vla-Item dicts "acad_tablestyle")) ;; Create a custom table style (setq key "MyTableStyle" class "AcDbTableStyle") (setq custObj (vla-AddObject dictObj key class)) ;; Set the name and description for the style (vla-put-Name custObj "MyTableStyle") (vla-put-Description custObj "This is my custom table style") ;; Sets the bit flag value for the style (vla-put-BitFlags custObj 1) ;; Sets the direction of the table, top to bottom or bottom to top (vla-put-FlowDirection custObj acTableTopToBottom) ;; Sets the supression of the table header (vla-put-HeaderSuppressed custObj :vlax-false) ;; Sets the horizontal margin for the table cells (vla-put-HorzCellMargin custObj 0.22) ;; Sets the supression of the table title (vla-put-TitleSuppressed custObj :vlax-false) ;; Sets the vertical margin for the table cells (vla-put-VertCellMargin custObj 0.22) ;; Set the alignment for the Data, Header, and Title rows (vla-SetAlignment custObj (+ acDataRow acTitleRow) acMiddleLeft) (vla-SetAlignment custObj acHeaderRow acMiddleCenter) ;; Set the background color for the Header and Title rows (setq colObj (vlax-create-object "AutoCAD.AcCmColor.19")) (vla-SetRGB colObj 98 136 213) (vla-SetBackgroundColor custObj (+ acHeaderRow acTitleRow) colObj) ;; Clear the background color for the Data rows (vla-SetBackgroundColorNone custObj acDataRow :vlax-true) ;; Set the bottom grid color for the Title row (vla-SetRGB colObj 0 0 255) (vla-SetGridColor custObj acHorzBottom acTitleRow colObj) ;; Set the bottom grid lineweight for the Title row (vla-SetGridLineWeight tableStyle acHorzBottom acTitleRow acLnWt025) ;; Set the inside grid lines visible for the data and header rows (vla-SetGridVisibility custObj acHorzInside (+ acDataRow acHeaderRow) :vlax-true) ;; Set the text height for the Title, Header and Data rows (vla-SetTextHeight custObj acTitleRow 1.5) (vla-SetTextHeight custObj (+ acDataRow acHeaderRow) 1.0) ;; Set the text height and style for the Title row (vla-SetTextStyle custObj (+ acDataRow acHeaderRow acTitleRow) "Standard") ;; Release the color object (vlax-release-object colObj) (princ) ) Quote Link to comment Share on other sites More sharing options...
student21 Posted January 28, 2015 Author Share Posted January 28, 2015 Earlier I posted a thread about a problem with a lisp routine that I found that needed a little tweeking. It seems that there was confusion about which routine I was referring to so I am attempting to resend the request with the program attached. The routine is a Line Bearing Table. I would like for it to use the current drawing's Text Style. Again any assistance would greatly appreciated. Please see attached. BEARING TBL.lsp Quote Link to comment Share on other sites More sharing options...
SLW210 Posted January 28, 2015 Share Posted January 28, 2015 Why did you create a new thread and why didn't you post them in the AutoLISP, Visual LISP & DCL Forum? I have moved and merged your threads. Quote Link to comment Share on other sites More sharing options...
student21 Posted January 28, 2015 Author Share Posted January 28, 2015 Needed to "attach" a file and did not see where to do that with "Quick Reply" Thanks 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.