Jump to content

Select By Handle


gpd

Recommended Posts

Hi All

 

Is it possible to select entities in by providing their HANDLE value to ssget or any other function. I have tried but result is nil.

 

 


Command: (setq han(vla-get-handle(vlax-ename->vla-object(car(entsel)))))

Select object: "B9"

Command: (setq ss(ssget "X" (list (cons 5 han))))

nil

Thanks

Link to comment
Share on other sites

Alternatively,

 

(vla-HandletoObject
 (vla-get-ActiveDocument
   (vlax-get-acad-object)
 )
 <handle>
)

 

Should you want the VLA Object...

 

(defun c:Test	( / ent-selected enthandle objHandle )

   (setq ent-selected (car (entsel))
  enthandle    (cdr (assoc 5 (entget ent-selected)))
  objHandle    (vla-get-handle (vlax-ename->vla-object ent-selected))
   )

   (entdel (handent enthandle)) ;; del the item
   (redraw)
;;;
;;; This would toss a nasty if used here..
;;;
;;;  (vla-HandletoObject
;;;    (vla-get-ActiveDocument
;;;      (vlax-get-acad-object)
;;;    )
;;;    objHandle
;;;  )

   (entdel (handent enthandle)) ;; un-del the item
   (redraw)

;;; Now we can select the items
;;;

   (vla-HandletoObject
     (vla-get-ActiveDocument
(vlax-get-acad-object)
     )
     objHandle
   )
 )

Link to comment
Share on other sites

  • 2 weeks later...

Hi All,

 

I want to do the same thing, but unfortunately haven't found the answer yet.

As fillet isn't easilly programmed I want to 'abuse' the commandline to do it.

 

Example: (Yes I still use VBA)

Sub Test4()
   Dim Commandstring As String
   Commandstring = "(command ""_fillet"" ""_p"" pause) "
   ThisDrawing.SendCommand (Commandstring)
End Sub

 

Now I would like to replace the "pause" with something that selects the polyline by handle.

 

Is that possible?

 

Thanks

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...