Double-click Edit Attribute

I've successfully customized the CUI to run my lisp routine when the user double-clicks on an attribute. I need to change the lisp routine to select the attribute they double-clicked on? Everything I try returns the block, not the specific attribute?

I expected something very simple like this to work ...

(setq ss1 (ssget "i:n")) or (setq ss1 (ssget "i:v"))

Thanks in advance for your help

Comments

  • Kerry Brown
    edited June 2019

    nentsel will allow the selection of the 'nested' attribute
    Try something like :
    (defun c:do-it () (if (setq selResult (nentsel)) (setq ent (car selResult)) ;else (exit) ) (setq selEname (entget ent)) ;; assume stuff :) ) (alert (strcat (cdr (assoc 2 selEname)) " : " (cdr (assoc 1 selEname)))) (princ) )

    image

  • Using nentsel will not work if you want the code to work in a double click action.

    (defun c:MyAttEdit ( / gr)
      (if (= 5 (car (setq gr (grread T))))
        (print (entget (car (nentselp (cadr gr)))))
      )
      (princ)
    )
    

    Note:
    Using (getvar 'lastpoint) to acquire the point for nentselp does not work properly if there is a preselection.

  • (setq ssText (ssget "i:v"))
    (setq oText (car (nentselp (cadar (cdddar (ssnamex ssText))))))

    this seems to be doing the trick :-)

  • Roy Klein Gebbinck
    edited June 2019

    Does "I:V" even work?

  • @Donald Broussard said:
    (setq ssText (ssget "i:v"))
    (setq oText (car (nentselp (cadar (cdddar (ssnamex ssText))))))

    this seems to be doing the trick :-)

    Giving credit to the author would have been polite.

  • Kerry Brown
    edited June 2019

    @Roy Klein Gebbinck said:
    Does "I:V" even work?

    Hi Roy,
    It does for me if the attribute is pre-selected, which I assume Donald is relying on with the double click

    Changing the DoubleClick functionality for attributes would mean that _eattedit would no longer be called

    ... but to each his own :)

  • I should have explained better:
    I believe that using ":V" has not effect when combined with "I".

  • Bricscad bug exposed ... It is not recognizing anonymous blocks correctly with double-click. Reported.

    Is it just me or has the quality of support taken a huge hit?
  • The support seems much better here to me in compared to Autodesk.
    This is just an observation of a newcomer to the application.

    C. Hill

  • @chillme1 said:
    The support seems much better here to me in compared to Autodesk.
    This is just an observation of a newcomer to the application.

    C. Hill

    Oh yes! Much better than Autodesk!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Click one of the buttons on the top bar to get involved!