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

Lisp Function: Returns the current Project.XML Path

1 REPLY 1
Reply
Message 1 of 2
tfs-us
328 Views, 1 Reply

Lisp Function: Returns the current Project.XML Path

I don't suspect too many people will find this valuable like I would, but I stumbled on it and thought i'd post it anyway.

 

This function will return the full file path of the currently loaded project.xml.

 

(defun GetProjectXML (/ xml)
  (vl-load-com)
(vlax-for x (vla-get-dictionaries(vla-get-activedocument(vlax-get-acad-object))) (if (= (strcase(vl-princ-to-string(vl-catch-all-apply 'vla-get-name (list x)))) "AUTODESK_PNP") (vlax-for xx x (if (= (strcase(vl-princ-to-string(vl-catch-all-apply 'vla-get-name (list xx)))) "PNP_PROJECTMGR") (vlax-for xxx xx (if (= (strcase(vl-princ-to-string(vl-catch-all-apply 'vla-get-name (list xxx)))) "PROJECTXML") (setq xml (cdr(assoc 1(entget(vlax-vla-object->ename xxx))))) ) ) ) ) ) ) xml )

 

1 REPLY 1
Message 2 of 2
tfs-us
in reply to: tfs-us

Well, I am sorry to inform that this method only yields the location the project.xml was originally created. Moving the project will result in it producing an incorrect value.

 

@Autodesk: This is a value already stored somewhere and it can't take more then a 60 seconds to expose it. So, can we please get a system variable for this!

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

Post to forums  

Autodesk Design & Make Report

”Boost