block in place editing

block in place editing

Anonymous
Not applicable
1,299 Views
10 Replies
Message 1 of 11

block in place editing

Anonymous
Not applicable

Hi, I really want to have the option to go into another block for in-place editing WITHOUT having to go out of the block i am editind in place now & then entering the other one - is there a way to do that? just like moving into another block via block editor - i am just asked if to save changes & i can go right away into another block...

Thanks!

0 Likes
1,300 Views
10 Replies
Replies (10)
Message 2 of 11

hmsilva
Mentor
Mentor

@Anonymous wrote:

Hi, I really want to have the option to go into another block for in-place editing WITHOUT having to go out of the block i am editind in place now & then entering the other one - is there a way to do that? just like moving into another block via block editor - i am just asked if to save changes & i can go right away into another block...

Thanks!


Hi Hanna,

maybe, in blockeditor:

 

Command:bsave

Command: bedit

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 3 of 11

Anonymous
Not applicable
thanks! but the whole point is when i am in block IN PLACE.........
0 Likes
Message 4 of 11

hmsilva
Mentor
Mentor

@Anonymous wrote:
thanks! but the whole point is when i am in block IN PLACE.........

My bad!!!! Smiley Embarassed

 

You'll have to close, to edit a new one...

 

Henrique

EESignature

0 Likes
Message 5 of 11

Anonymous
Not applicable
yep 😞 so i was wondering if maybe there is some kind of a lisp to do that...?
0 Likes
Message 6 of 11

ВeekeeCZ
Consultant
Consultant

This routine makes close/open for you.

 

The question is what to do with current block: always save? always not? or ask the user.

 

(defun c:EditInPlace ( / ss)
  (if (setq ss (ssget ":S" '((0 . "INSERT"))))
    (progn
      (command "_.refclose")
      (while (> (getvar 'CMDACTIVE) 0)
	(command
	  	"_save"  ; change to "_discard" or PAUSE
		))))   
  (command "_.-refedit" (cdr (assoc 10 (entget (ssname ss 0)))) "_o" "_a" "_y")
  (princ)
)
  
0 Likes
Message 7 of 11

Anonymous
Not applicable
Wow thanks! it's almost there... first of all i want to have a choice to save or discard...second - because i have nested block it gives an error (*Invalid selection*
Expects a single object.
; error: Function cancelled)
what i would like is for the "referance edit" window to open when i select the second block- just like the program does in the first place
thank you so much!!
0 Likes
Message 8 of 11

marko_ribar
Advisor
Advisor

@ВeekeeCZ wrote:

This routine makes close/open for you.

 

The question is what to do with current block: always save? always not? or ask the user.

 

(defun c:EditInPlace ( / ss)
  (if (setq ss (ssget ":S" '((0 . "INSERT"))))
    (progn
      (command "_.refclose")
      (while (> (getvar 'CMDACTIVE) 0)
	(command
	  	"_save"  ; change to "_discard" or PAUSE
		))))   
  (command "_.-refedit" (cdr (assoc 10 (entget (ssname ss 0)))) "_o" "_a" "_y")
  (princ)
)
  

Hi BeekeeCZ, I am afraid that this isn't so simple... If that would be solution then this would be solved long time ago...

https://www.theswamp.org/index.php?topic=48470.0

 

Hint : This line marked red is probably wrong - you have to find reactive points on entity you wish to edit in place like it's explained in link I just pointed you...

 

Also worth of looking is this topic ... :

https://www.theswamp.org/index.php?topic=50585.0

 

HTH, M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 9 of 11

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:
...second - because i have nested block it gives an error (*Invalid selection* 
Expects a single object.
; error: Function cancelled)
what i would like is for the "referance edit" window to open when i select the second block- just like the program does in the first place
thank you so much!!

Could you more elaborate this "i have nested block"... you're IN nested block or you're selecting block with nested block... I'm not able to reproduce this - can you post some sample?


Not sure what you mean - do you mean contextual ribbon or right-click shortcut menu? You can add this command into both - use _CUI.

 

The third - Marco referred some issues with this approach - I don't have time to go throw all of it - it looks like that is just 3d thing. Not sure. Let know if this is your issue as well. 

@marko_ribar thanks for the heads up!

 

Save prompt:

Spoiler
(defun c:EditInPlace ( / ss)
  (if (setq ss (ssget ":S" '((0 . "INSERT"))))
    (progn
      (command "_.refclose")
      (while (> (getvar 'CMDACTIVE) 0)
	(command PAUSE))
      (command "_.-refedit" (cdr (assoc 10 (entget (ssname ss 0)))) "_o" "_a" "_y")))
  (princ)
)
0 Likes
Message 10 of 11

Anonymous
Not applicable

hi BeeKeeCZ, I wanna go into a nested block & am coming out of one too, i wanna have the option to go into any block either by picking it on screen or selecting from a list - just like the window of "referance edit" gives. thanks!

0 Likes
Message 11 of 11

ВeekeeCZ
Consultant
Consultant

Ok... After some elaboration I decided make it simple... I think the best way is to make two buttons

 

- Save and Edit Next

- No Save end Edit Next

 

(defun c:SaveAndNext nil
  (initdia)
  (command "_.refclose" "_sav"
	   "_.refedit")
  (princ)
)

(defun c:NoSaveAndNext nil
  (initdia)
  (command "_.refclose" "_dis"
	   "_.refedit")
  (princ)
)

In _CUI create these two buttons... Macro would be just: SaveAndNext, name it e.g. "Save\rEdit Next"... and add it into Ribbon/Panels/Reference Edit - Edit Reference

0 Likes