Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing text style used by table style via LISP

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
mbohn
2677 Views, 3 Replies

Changing text style used by table style via LISP

I am looking for a way to change the text style used by a table style with Visual LISP.  So far I have been able to get the IAcadTableStyle object from the acad_tablestyle dictionary, but there is no property for text style.  Is this even possible?  Code and results are below.

 

Mark

 

(defun DumpTableStyles ()
(setq dict (vla-get-dictionaries (vla-get-activedocument(vlax-get-acad-object))))
(setq TableStyles (vla-item dict "acad_tablestyle"))
(vlax-for TableStyle TableStyles
(vlax-dump-object TableStyle)
)
)

 

; IAcadTableStyle: AutoCAD IAcadTableStyle Interface
; Property values:
; Application (RO) = #<VLA-OBJECT IAcadApplication 0000000140d391d8>
; BitFlags = 0
; Description = "Standard"
; Document (RO) = #<VLA-OBJECT IAcadDocument 000000002813de30>
; FlowDirection = 0
; Handle (RO) = "1D"
; HasExtensionDictionary (RO) = -1
; HeaderSuppressed = 0
; HorzCellMargin = 0.06
; Name = "Standard"
; NumCellStyles (RO) = 3
; ObjectID (RO) = 44
; ObjectID32 (RO) = 44
; ObjectName (RO) = "AcDbTableStyle"
; OwnerID (RO) = 42
; OwnerID32 (RO) = 42
; TemplateId = 0
; TemplateId32 = 0
; TitleSuppressed = 0
; VertCellMargin = 0.06
T

3 REPLIES 3
Message 2 of 4
kefer_kb
in reply to: mbohn

Hello,

it's easy with pure lisp:

(entget (cdr (assoc 350 (dictsearch (namedobjdict) "ACAD_TABLESTYLE"))))

 

(-1 . <Objektname: 7ffff75ad60>)
(0 . "TABLESTYLE")
(5 . "11FE")
(102 . "{ACAD_REACTORS")
(330 . <Objektname: 7ffff75ab20>)
(330 . <Objektname: 7ffff75adb0>)
(102 . "}")
(330 . <Objektname: 7ffff75ab20>)
(100 . "AcDbTableStyle")
(280 . 0)
(3 . "Standard")
(70 . 0)
(71 . 0)
(40 . 1.5)
(41 . 1.5)
(280 . 0)
(281 . 0)
(7 . "neutextstil")
(140 . 4.5)
(170 . 2)
(62 . 0)
(63 . 7)
(283 . 0)
(90 . 512)
(91 . 0)
(1 . "")
(274 . -2)
(284 . 1)
(64 . 0)
(275 . -2)
(285 . 1)
(65 . 0)
(276 . -2)
(286 . 1)
(66 . 0)
(277 . -2)
(287 . 1)
(67 . 0)
(278 . -2)
(288 . 1)
(68 . 0)
(279 . -2)
(289 . 1)
(69 . 0)
(7 . "STANDARD")
(140 . 6.0)
(170 . 5)
(62 . 0)
(63 . 7)
(283 . 0)
(90 . 512)
(91 . 0)
(1 . "")
(274 . -2)
(284 . 1)
(64 . 0)
(275 . -2)
(285 . 1)
(65 . 0)
(276 . -2)
(286 . 1)
(66 . 0)
(277 . -2)
(287 . 1)
(67 . 0)
(278 . -2)
(288 . 1)
(68 . 0)
(279 . -2)
(289 . 1)
(69 . 0)
(7 . "STANDARD")
(140 . 4.5)
(170 . 5)
(62 . 0)
(63 . 7)
(283 . 0)
(90 . 512)
(91 . 0)
(1 . "")
(274 . -2)
(284 . 1)
(64 . 0)
(275 . -2)
(285 . 1)
(65 . 0)
(276 . -2)
(286 . 1)
(66 . 0)
(277 . -2)
(287 . 1)
(67 . 0)
(278 . -2)
(288 . 1)
(68 . 0)
(279 . -2)
(289 . 1)
(69 . 0)

 

DXF-Code no. 7 is the name for textstyle to title, header and data.

 

e.g.: 'neutextstil' is textstyle for data entries.

 

kind regards,

Franz

www.gfm.at
Message 3 of 4
mbohn
in reply to: kefer_kb

Well... duh!  Thanks Franz!

 

Mark

 

Message 4 of 4
pfillion
in reply to: mbohn

I tried this code but I keep getting: ; error: extra cdrs in dotted pair on input

What is the lisp that worked

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost