handasa 发表于 2022-7-5 16:11:24

lisp to unlock table cells (th

Greetings everyone ..
i have a tables inserted to autocad from excel and these tables are locked for editing ... is there a method to unlock these tables and remove their data links using lisp routine ?
 
 
thanks for reading
best regards..

rlx 发表于 2022-7-5 16:19:52

I have found a few lisps on the net (because I rarely use tables my self) and combined them but its slow ...
 
 

; http://adndevblog.typepad.com/autocad/2012/04/autolisp-example-create-a-table-using-activex.html; By Wayne Brill(defun c:addMyTable ( / ActiveDocument mSpace pt            myTable nRows nCols row cell )(vl-load-com)(setq ActiveDocument (vla-get-activedocument             (vlax-get-acad-object)))(setq mSpace(vla-get-modelspace ActiveDocument))(setq pt (vlax-make-safearray vlax-vbDouble                                 '(0 . 2)));insertion point for the table(vlax-safearray-fill pt '(2.0 2.0 0.0))(setq myTable   (vla-addtable mSpace pt 5 5 10 30))(vla-setcelltextheight myTable 0 0 5)(vla-settext myTable 0 0 "myTable")   ;rows and columns zero based(setq nRows(- (vla-get-rows myTable) 1))(setq nCols(- (vla-get-columns myTable) 1))   ; rows and columns after row 0, column 0(setq row 1)(setQ cell 0)   ; loop through cells(while (vla-object myTable))   (setq nRows (- (vla-get-rows myTable) 1))   (setq nCols (- (vla-get-columns myTable) 1))   (setq row 1)      (setq cell 0)   (princ (strcat "\n\nNumers : " (itoa nRows) " rows , " (itoa nCols) " columns\nPress any key to continue"))   (grread)   ; thank you Grrr/Lee/Tharwat   ; http://www.cadtutor.net/forum/showthread.php?101239-lisp-to-unlock-table-cells-(the-whole-table-at-once)   (vla-put-RegenerateTableSuppressed myTable :vlax-true)   (while (

Grrr 发表于 2022-7-5 16:30:45

 
Rlx you have to wrap it like this:

(vla-put-RegenerateTableSuppressed ACADTableObj :vlax-true); < Manipulate the table here >(vla-put-RegenerateTableSuppressed ACADTableObj :vlax-false)

Grrr 发表于 2022-7-5 16:42:32

 
No problem, I didn't knew about this either so I had to wait 5 minutes to generate a sorted room table for 90 different rooms, until one day I learned about this on the forums from Lee or Tharwat (don't really remember who was), and now its immediately created or manipulated. So shout outs to them!
 

rlx 发表于 2022-7-5 16:50:38

Thank you Lee / Tharwat / Grrr

Tharwat 发表于 2022-7-5 17:00:23

Thank you guys.

handasa 发表于 2022-7-5 17:04:29

thank you all ... your contributions are greatly appreciated ... thanks again

handasa 发表于 2022-7-5 17:15:49

 
this is The Missing Piece Puzzle that solved a lot of table processing functions that i made before ... thanks ,Grrr
页: [1]
查看完整版本: lisp to unlock table cells (th