0 Members and 1 Guest are viewing this topic.
Cool code! Thanks for LM and Tharwat.
you may need to test if the cell is merged, not sure with com
Quote from: e2002 on January 02, 2015, 09:41:49 AMCool code! Thanks for LM and Tharwat.You're welcome! Seemed that GetCellExtents only get the boundary of cell content area, so need to add the horizontal and vertical margins into the the calculation to get the exact cell corner.Quote from: nullptr on January 02, 2015, 09:44:44 AMyou may need to test if the cell is merged, not sure with comA good point - after some brief testing, it would appear that the ActiveX getcellextents method accounts for this if the queried cell is the leftmost/topmost cell of those merged. With this in mind, something like this should suffice:Code - Auto/Visual Lisp: [Select](defun cellextents ( obj row col / a b c d lst rtn ) (if (= :vlax-true (vla-ismergedcell obj row col 'a 'b 'c 'd)) (setq row a col c) ) (setq lst (vlax-invoke obj 'getcellextents row col :vlax-true)) (repeat 4 (setq rtn (cons (list (car lst) (cadr lst) (caddr lst)) rtn) lst (cdddr lst))) (reverse rtn))
Quote from: Lee Mac on January 02, 2015, 10:27:03 AMQuote from: e2002 on January 02, 2015, 09:41:49 AMCool code! Thanks for LM and Tharwat.You're welcome! Seemed that GetCellExtents only get the boundary of cell content area, so need to add the horizontal and vertical margins into the the calculation to get the exact cell corner.
Quote from: e2002 on January 02, 2015, 09:41:49 AMCool code! Thanks for LM and Tharwat.You're welcome!
Doubt I'll ever had a use for this, but it's still pretty damn cool. Well done, Lee.