Ashish123 Posted October 29, 2018 Posted October 29, 2018 Hello, I have 5000 drawings that contains three specific tables. All these tables are linked to external Excel using data links. The main issue i have is, after the data link is removed the cell content of all three tables remain locked. Is there any way to unlock the cells using lisp??. I know i can do it manually but i don't want to go that route unless it is the only the way to do so. Please take a look at the drawing & lsp file. Trial.dwg Thank you very much. Regards, A AUTOCAD AUTOMATION.LSP Quote
Ashish123 Posted October 29, 2018 Author Posted October 29, 2018 (defun AH:unlockcell ( / x y) (setvar 'ctab "Model") (setq y 0) (setq ss (ssget "X" (list (cons 0 "ACAD_TABLE")))) (repeat (setq X (sslength ss)) (setq obj (vlax-ename->vla-object(ssname ss (setq x (- x 1))))) (setq nRows (- (vla-get-rows obj) 1)) (setq nCols (- (vla-get-Columns obj) 1)) (setq row 0) (setq cell 0) (vla-put-RegenerateTableSuppressed obj :vlax-true) (while (<= row nRows) (while (<= cell nCols) (vla-setcellstate obj row Cell 0) (setq cell (1+ cell)) (princ (strcat "\nRow : " (itoa row) " , cell " (itoa cell))) );while (setq row (1+ row)) (setq cell 0) ) (vla-put-RegenerateTableSuppressed obj :vlax-false) )(princ) ) (AH:unlockcell) Quote
Ashish123 Posted October 29, 2018 Author Posted October 29, 2018 The above code selects all tables with 1 or more columns and unlocks the content of the cells for all tables within the drawing. looked thru so many thread and combined so many codes to come up with this code. thank you all very much helping me out. Regards, A Quote
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.