Jump to content

RefEdit - Is selection in Working set ?


chavlji

Recommended Posts

Hello

If we use Ref editor (in place editor), Objects that are inside that block becomes editable, while all other objects in drawing are locked and dimmed but still selectable... now:

 

How is it possible to determine that certain selected entity is inside working set? To tell that certain selected eg. line belongs to currently edited block, that it is not dimmed...

 

 

I've checked list of sel object returned from entget, but there is no entry such as "EntityParent"...

Link to comment
Share on other sites

You can use VBA to determine it. In VBA, object have the OwnerID. Then the function: Thisdrawing.ObjectIDToOBject(object.OwnerID) would return the owner object of the object. Compare it with the block definition object you are editing in place: using system variable "Refeditname" to retrieve the name of that blockdef

Link to comment
Share on other sites

Why is the following code not working?

It always returns "*Model_space"

(defun C:GetBlkParent ()
 (vl-load-com)
 (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
 (setq SS (ssget "_:S" '((0 . "INSERT") ))
       EntName (cadr (car (ssnamex SS))) 
       OwnerID (vla-get-OwnerId (vlax-ename->vla-object EntName))
       OwnerObj(vla-ObjectIdToObject doc OwnerID)
       Owner (vla-get-name OwnerObj))
 (princ Owner)
 (princ)
)

I start RefEdit on Block1 that has nested Block2 in its definition. In editor I select Block2 and call GetBlkParent. I get "*Model_space" while it should return "Block1" !

Link to comment
Share on other sites

It seems RefEdit works this way that it actually explodes the block. So all objects from block definition actually become owned by Model_Space while user is in RefEdit...

 

So this wont work. Anything else? Please, anything !

Link to comment
Share on other sites

I made it !!! :

(defun IsEditable( EntName )
  (setq PrevPt (jGetBasePoint EntName)) 
  (command "move" ss "" "d" (list 100 0 0) )
  (setq NewPt (jGetBasePoint EntName) )
  (command "move" ss "" "d" (list -100 0 0) )
  (not (equal PrevPt NewPt))
  )

 

:wink:

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...