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

Open Windows Explorer

1 REPLY 1
Reply
Message 1 of 2
Anonymous
301 Views, 1 Reply

Open Windows Explorer

OK...forgive me for but I'm by no means a technical guru when it comes to Civil 3D.  Years ago I created a button that when clicked it would open windows explorer to the exact location of whatever drawing you were in.  It also highlighted the drawing file.  Pretty handy.  Now we have added Vault and it has confused my icon.  When Civil 3D and Vault are used together, projects are copied to my C: drive.  As a company we set up project numbers and have several different drives for different offices.  For instance our Lancaster office is the H: drive.  This is where most of my projects are started and where all the project related info is stored.  Being that jobs are copied to my C: and this is where they are saved automatically, my button opens my C: and not the original project.  I was wondering if there was a change I could make to the macro to have it direct itself to the root project number and not the copied location.

 

(STARTAPP (strcat "EXPLORER /select, " (getvar "dwgprefix") (getvar "dwgname")", /e"))

1 REPLY 1
Message 2 of 2
BlackBox_
in reply to: Anonymous

We do not use vault, so forgive the simple response... Since you have a known 'root' drive (in your case the H:\) that might replace the C:\, you could simply us vl-String-Subst.

 

You could also store/call this 'root' drive letter value to registry via Setenv/Getenv if you don't want it hard-coded, but do want it to be persistent from session to session.

 

(defun c:FOO (/ dwg file)
  (if (setq file
	     (findfile
	       (vl-string-subst
		 "H:"
		 "C:"
		 (strcat (getvar 'dwgprefix) (setq dwg (getvar 'dwgname)))
	       )
	     )
      )
    (startapp (strcat "explorer /select, " file ", /e"))
    (prompt (strcat "\n** Drawing \"" dwg "\" not found ** "))
  )
)


"How we think determines what we do, and what we do determines what we get."

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report