Shortcut to change table cell style

Shortcut to change table cell style

Anonymous
Not applicable
646 Views
5 Replies
Message 2 of 6

Shortcut to change table cell style

Anonymous
Not applicable

Hello everyone,

Does anyone know if its at all possible to create a shortcut (so I could create a custom button/icon on a palette and then possibly give it a keyboard shortcut) to change the cell style within the selected table?

I know I can right click the cell and then navigate through a couple of menus to do this.  Can also do it from the 'table' palettes up the top of the toolbar but this is a task I do so often and I only ever flick between two cell styles so having a shortcut/icon/lisp routine for either of the required styles actually would be far more convenient and save time.

Anyone clever have any suggestions about this might be achieved?

Thanks for reading guys.

 

Brad

0 Likes
647 Views
5 Replies
Replies (5)
Message 1 of 6

Anonymous
Not applicable

Hello everyone,

Does anyone know if its at all possible to create a shortcut (so I could create a custom button/icon on a palette and then possibly give it a keyboard shortcut) to change the cell style within the selected table?

I know I can right click the cell and then navigate through a couple of menus to do this.  Can also do it from the 'table' palettes up the top of the toolbar but this is a task I do so often and I only ever flick between two cell styles so having a shortcut/icon for either of the required styles actually would be far more convenient and save time.

Anyone clever have any suggestions about this..?

Thanks for reading guys.

 

Brad

0 Likes
Message 3 of 6

Sea-Haven
Mentor
Mentor

You need 2 things the table and the cell row column

 

 

(setq xxx (entsel "\npick a cell "))
(vla-HitTest
    (vlax-ename->vla-object (car xxx))
    (vlax-3d-point (cadr xxx))
    (vlax-3d-point (trans (getvar 'ViewDir) 1 0))
    'outRow
    'outCol

)

 

 as above.

 

The object needs to be a VL table object so (setq objtable (vlax-ename->vla-object (car xxx)))

 

Then can use setcell to change a property.

0 Likes
Message 4 of 6

Anonymous
Not applicable

Hey thanks heaps for the swift reply.  Really sorry but your answer is still well above my paygrade.  I apologise for being so painful but is there any chance you might expand or include an example of what you mean..?

0 Likes
Message 5 of 6

Sea-Haven
Mentor
Mentor

You need to explain more what exactly you want to do to the cell.

 

(setq ent (entsel "\npick a cell "))
(setq obj (vlax-ename->vla-object (car ent)))
(vla-HitTest
    obj
    (vlax-3d-point (cadr ent))
    (vlax-3d-point (trans (getvar 'ViewDir) 1 0))
    'outRow
    'outCol
)

; so now need a setcell command

(vla-SetTextheight Obj outrow outcol 5.0)
0 Likes
Message 6 of 6

Anonymous
Not applicable

I was a little light on info.  Basically...

Table style/type is "Standard" and I need to flick cell C3 between "Data" and "Data BOTOM" styles and also cell A3 between "Header2" and "Header2 BOTTOM" styles.

Does that help any?

0 Likes