Getting dwg directory

Getting dwg directory

DGRL
Advisor Advisor
791 Views
1 Reply
Message 1 of 2

Getting dwg directory

DGRL
Advisor
Advisor

I already have my LSP working properly

Reason why it did not work correctly is because I forgot to add an double \\ LOL

 

 

Dear forum members

 

Currently working on a lisp file and I need the dwg directory in a variable

Dwgprefix will give me an path but woth double \\

 

"D:\\P3D TEST\\TEST PROJECT\\Orthos\\DWGs\\"


Does anyone know how to remove an single \ in the path? and how top change them into / ( windows standard )

I need the path to copy and saveas an dwg file and I don't like to hard code the dwg path in my lsp

 

An different approach is also welcome

 

Best regards,

 

 

If this was of any help please kudo and/or Accept as Solution
Kind Regards
0 Likes
Accepted solutions (1)
792 Views
1 Reply
Reply (1)
Message 2 of 2

DannyNL
Advisor
Advisor
Accepted solution

This is one possibility.

 

(setq path (vl-string-right-trim "\\"(getvar "DWGPREFIX")))
(while
   (vl-string-search "\\" path)
   (setq path (vl-string-subst "/" "\\" path))
)
0 Likes