Community
AutoCAD MEP Forum
Welcome to Autodesk’s AutoCAD MEP Forums. Share your knowledge, ask questions, and explore popular AutoCAD MEP topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do you find an MvPart in a drawing by "handle"?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
dbillion
493 Views, 3 Replies

How do you find an MvPart in a drawing by "handle"?

Greetings,

 

I'm working in AutoCAD MEP 2011.

 

When running a clash detection of a 6-story building in Navisworks (each floor is a separate construct file), I can select an MvPart in the view and get that element's handle (unique identifier).  How can I find that particular part in the construct file, by searching for its handle?

 

Is there a lsp routine out there that allows the user to enter a MvPart's handle, and have the program zoom to that part?

 

Many thanks,

Dave

3 REPLIES 3
Message 2 of 4
jcampbell924
in reply to: dbillion

Dave,

 

Try the below

 

code:

(defun C:HANDLE ( / handle ent ) 
(setq handle (getstring "\nEnter handle to search for: ")) 
(setq ent (handent handle)) 
(if ent 
(progn ;line added 
(sssetfirst nil (ssadd ent)) 
(command "_zoom" "_Object" ent) 
) 
;Else 
(ALERT "The handle you entered does not exist in this drawing!") 
) 
(princ) 
) 
;;
;;
;;
(defun OwnerName (handle)
  (cdr (assoc 2 (entget (cdr (assoc 330 (entget (handent handle)))))))
)

 

 

Message 3 of 4
dbillion
in reply to: jcampbell924

Works!  Just what I was looking for.  Thanks.

Message 4 of 4
jcampbell924
in reply to: dbillion

Welcome.  You may want to mark my post as the solution.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost