chavlji Posted March 14, 2009 Share Posted March 14, 2009 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"... Quote Link to comment Share on other sites More sharing options...
LINHOREKA Posted March 17, 2009 Share Posted March 17, 2009 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 Quote Link to comment Share on other sites More sharing options...
chavlji Posted March 18, 2009 Author Share Posted March 18, 2009 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" ! Quote Link to comment Share on other sites More sharing options...
chavlji Posted March 18, 2009 Author Share Posted March 18, 2009 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 ! Quote Link to comment Share on other sites More sharing options...
chavlji Posted March 18, 2009 Author Share Posted March 18, 2009 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: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.