Has anyone made a customization to access block editor in table (table cell containing a block)?
Could be a command, a right click choice etc. By default, without such shortcut, you will firstly need to check the block name that is inserted by clicking the table cell, then run Bedit and scroll down to find the block.
thanks
Solved! Go to Solution.
Solved by Lee_Mac. Go to Solution.
Try the following:
;; Table Block Edit - Lee Mac ;; Opens the block associated with a selected table cell in the Block Editor (defun c:tbedit ( / *error* cel def idx lst sel ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (princ) ) (cond ( (null (setq sel (ssget "_X" (list '(0 . "ACAD_TABLE") (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model") ) ) ) ) ) (princ "\nNo tables found in current layout.") ) ( (progn (repeat (setq idx (sslength sel)) (setq lst (cons (vlax-ename->vla-object (ssname sel (setq idx (1- idx)))) lst)) ) (while (progn (setq cel (getpoint "\nPick block cell: ")) (cond ( (null cel) nil) ( (null (setq cel (LM:getcell lst (trans cel 1 0)))) (princ "\nNo cell found at point.") ) ( (/= acblockcell (apply 'vla-getcelltype cel)) (princ "\nCell does not contain a block.") ) ( (vl-catch-all-error-p (setq def (vl-catch-all-apply 'LM:getcellblock cel))) (princ (strcat "\nError retrieving block: " (vl-catch-all-error-message def) ) ) ) ) ) ) (= 'vla-object (type def)) ) (vl-cmdf "_.bedit" (vla-get-name def)) ) ) (princ) ) ;; Get Table Cell Block - Lee Mac ;; Returns the Block Definition associated with a given table cell (defun LM:getcellblock ( tab row col ) (eval (list 'defun 'LM:getcellblock '( tab row col ) (if (and (wcmatch (getenv "PROCESSOR_ARCHITECTURE") "*64*") (vlax-method-applicable-p tab 'getblocktablerecordid32) ) (list 'vla-objectidtoobject32 (LM:acdoc) '(vla-getblocktablerecordid32 tab row col)) (list 'vla-objectidtoobject (LM:acdoc) '(vla-getblocktablerecordid tab row col)) ) ) ) (LM:getcellblock tab row col) ) ;; Get Cell - Lee Mac ;; If the supplied point lies within a cell boundary, ;; returns a list of: (<VLA Table Object> <Row> <Col>) (defun LM:getcell ( lst pnt / dir ) (setq dir (vlax-3D-point (trans (getvar 'viewdir) 1 0)) pnt (vlax-3D-point pnt) ) (vl-some '(lambda ( tab / row col ) (if (= :vlax-true (vla-hittest tab pnt dir 'row 'col)) (list tab row col) ) ) lst ) ) ;; Active Document - Lee Mac ;; Returns the VLA Active Document Object (defun LM:acdoc nil (eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object)))) (LM:acdoc) ) (vl-load-com) (princ)
Hi Lee do you have anything like this but for the linetypeTableRecord?
I'd like to check some custom linetypes we've made that have caused issues here and there.
@Anonymous wrote:Hi Lee do you have anything like this but for the linetypeTableRecord?
I'd like to check some custom linetypes we've made that have caused issues here and there.
Do you mean a program wherein the user would select a line with a custom linetype and the associated .lin file would open in notepad?
If so, this may be difficult since, similar to AutoLISP programs, once a linetype is loaded into a drawing, to my knowledge there is no way to trace it back to its linetype definition file - this is compounded by the fact that I believe it is possible to generate custom linetypes in a drawing by using entmake[x] (i.e. without using a .lin file).
Lee
Moreso that we've had errors in our cad system that an audit has pointed to the acdbLinetypetable, was trying to look further into the cause.
Hi,
I use Lee Mac's 'tbedit' for modifying drawing legend table blocks. To create a new object description in Legend I add new row in the table and copy existing row with similar legend block to the new row (cells) and then modify the new row block cell.
It would be excellent having 'tbedit' with a few extra steps. The goal would be editing block in selected table cell and replacing the block in the cell with the new block created in bedit-saveas procedure. The new block name should be based on original block name (with lisped) etc.
Is there's a ability to accomplish this, guys?
Thank you