Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Contributor
jberry50
Posts: 17
Registered: ‎04-11-2006
Message 1 of 8 (115 Views)

Change multiple dxf codes

115 Views, 7 Replies
04-12-2006 09:26 AM
I am trying to modify the dxf code 142 of a Acad_Table object. This would be easy if there were only one 142 code but there is as many 142 codes as there are columns. And this is why I would like to change say the third 142 code. How would I go about stepping my way through the previous codes to get to the correct one or ones.
Thanks for any help.
Distinguished Contributor
EC-CAD
Posts: 5,929
Registered: ‎12-12-2003
Message 2 of 8 (115 Views)

Re: Change multiple dxf codes

04-12-2006 09:39 AM in reply to: jberry50
Something like this:
.. where 'entlst' is entity-list of the Entity.

(repeat (length entlst)
(setq elist (car entlst)); first set of values
(setq code (car elist)); dxf code
(setq value (cdr elist)); value
(if (= (type code) 'INT)
(progn
(if (= code 142)
(progn
........ count which one you want
........ take appropriate action
); progn
); if
); progn
); if
(setq entlst (cdr entlst)); shorten entlst list
); repeat

.. the trick is to:
(setq entlst (cdr entlst)); shorten entlst list
Bob
Distinguished Contributor
BillZ
Posts: 4,707
Registered: ‎12-12-2003
Message 3 of 8 (115 Views)

Re: Change multiple dxf codes

04-12-2006 10:02 AM in reply to: jberry50
Jon,

Use vla methods.

(vla-get-Columns test_table) ; number of colums

Command: (vla-getColumnWidth test_table "0")
2.0

(vla-setColumnWidth test_table "0" 4.0) ;set column width

Bill
Contributor
jberry50
Posts: 17
Registered: ‎04-11-2006
Message 4 of 8 (115 Views)

Re: Change multiple dxf codes

04-12-2006 10:19 AM in reply to: jberry50
Bill,
Thanks again for you help on this. Are these vla functions listed somewhere in the help files because I didnt see any thing for column width.
Distinguished Contributor
BillZ
Posts: 4,707
Registered: ‎12-12-2003
Message 5 of 8 (115 Views)

Re: Change multiple dxf codes

04-12-2006 10:23 AM in reply to: jberry50
Just "dump" the object onto the screen.
Your vlide will have them too.

VB/Activex developers guide has it too.

Command: (vlax-dump-object test_table t)
; IAcadTable: IAcadTable Interface
; Property values:
; Application (RO) = #
; Columns = 3
; ColumnWidth (RO) = ...Indexed contents not shown...
; Direction = (1.0 0.0 0.0)
; Document (RO) = #
; FlowDirection = 0
; Handle (RO) = "423D"
; HasExtensionDictionary (RO) = 0
; HasSubSelection (RO) = 0
; HeaderSuppressed = 0
; Height = 1.17333
; HorzCellMargin = 0.06
; Hyperlinks (RO) = #
; InsertionPoint = (129.087 -10.6949 0.0)
; Layer = "0"
; Linetype = "ByLayer"
; LinetypeScale = 1.0
; Lineweight = -1
; MinimumTableHeight (RO) = 1.17333
; MinimumTableWidth (RO) = 1.11
; ObjectID (RO) = 2126552552
; ObjectName (RO) = "AcDbTable"
; OwnerID (RO) = 2130586872
; PlotStyleName = "ByLayer"
; RowHeight (RO) = ...Indexed contents not shown...
; Rows = 3
; StyleName = "Standard"
; TableStyleOverrides (RO) = nil
; TitleSuppressed = 0
; TrueColor = #
; VertCellMargin = 0.06
; Visible = -1
; Width = 8.0
; Methods supported:
; ArrayPolar (3)
; ArrayRectangular (6)
; ClearSubSelection ()
; ClearTableStyleOverrides (1)
; Copy ()
; Delete ()
; DeleteCellContent (2)
; DeleteColumns (2)
; DeleteRows (2)
; GenerateLayout ()
; GetAlignment (1)
; GetAttachmentPoint (2)
; GetAutoScale (2)
; GetBackgroundColor (1)
; GetBackgroundColorNone (1)
; GetBlockAttributeValue (3)
; GetBlockRotation (2)
; GetBlockScale (2)
; GetBlockTableRecordId (2)
; GetBoundingBox (2)
; GetCellAlignment (2)
; GetCellBackgroundColor (2)
; GetCellBackgroundColorNone (2)
; GetCellContentColor (2)
; GetCellExtents (3)
; GetCellGridColor (3)
; GetCellGridLineWeight (3)
; GetCellGridVisibility (3)
; GetCellStyleOverrides (2)
; GetCellTextHeight (2)
; GetCellTextStyle (2)
; GetCellType (2)
; GetColumnWidth (1)
; GetContentColor (1)
; GetExtensionDictionary ()
; GetFieldId (2)
; GetGridColor (2)
; GetGridLineWeight (2)
; GetGridVisibility (2)
; GetMinimumColumnWidth (1)
; GetMinimumRowHeight (1)
; GetRowHeight (1)
; GetRowType (1)
; GetSubSelection (4)
; GetText (2)
; GetTextHeight (1)
; GetTextRotation (2)
; GetTextStyle (1)
; GetXData (3)
; Highlight (1)
; HitTest (4)
; InsertColumns (3)
; InsertRows (3)
; IntersectWith (2)
; IsMergedCell (6)
; MergeCells (4)
; Mirror (2)
; Mirror3D (3)
; Move (2)
; RecomputeTableBlock (1)
; ReselectSubRegion ()
; Rotate (2)
; Rotate3D (3)
; ScaleEntity (2)
; Select (8)
; SelectSubRegion (10)
; SetAlignment (2)
; SetAutoScale (3)
; SetBackgroundColor (2)
; SetBackgroundColorNone (2)
; SetBlockAttributeValue (4)
; SetBlockRotation (3)
; SetBlockScale (3)
; SetBlockTableRecordId (4)
; SetCellAlignment (3)
; SetCellBackgroundColor (3)
; SetCellBackgroundColorNone (3)
; SetCellContentColor (3)
; SetCellGridColor (4)
; SetCellGridLineWeight (4)
; SetCellGridVisibility (4)
; SetCellTextHeight (3)
; SetCellTextStyle (3)
; SetCellType (3)
; SetColumnWidth (2)
; SetContentColor (2)
; SetFieldId (3)
; SetGridColor (3)
; SetGridLineWeight (3)
; SetGridVisibility (3)
; SetRowHeight (2)
; SetSubSelection (4)
; SetText (3)
; SetTextHeight (2)
; SetTextRotation (3)
; SetTextStyle (2)
; SetXData (2)
; TransformBy (1)
; UnmergeCells (4)
; Update ()
T Message was edited by: BillZ
*T.Willey
Message 6 of 8 (115 Views)

Re: Change multiple dxf codes

04-12-2006 10:26 AM in reply to: jberry50
They are in the help. Look for ActiveX controls.

--

Tim
"A blind man lets nothing block his vision."



wrote in message news:5140722@discussion.autodesk.com...
Bill,
Thanks again for you help on this. Are these vla functions listed somewhere
in the help files because I didnt see any thing for column width.
Contributor
jberry50
Posts: 17
Registered: ‎04-11-2006
Message 7 of 8 (115 Views)

Re: Change multiple dxf codes

04-12-2006 10:30 AM in reply to: jberry50
Thanks again for all your help.
Distinguished Contributor
BillZ
Posts: 4,707
Registered: ‎12-12-2003
Message 8 of 8 (115 Views)

Re: Change multiple dxf codes

04-12-2006 10:31 AM in reply to: jberry50
>>>Thanks again for all your help.

Glad to help.

Bill
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.