Quantcast
Channel: Autodesk India Community aggregator
Viewing all articles
Browse latest Browse all 1680

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Return name of different folders

$
0
0

Hello all,

 

The following gives me the first folder string, with no back-slashes, that the drawing exists in.

 

(setq FirstFolder
 ((lambda (/ tmpDir tmpPos)
 (substr
 (setq tmpDir (getvar "dwgprefix"))
 (+ 2 (setq tmpPos (vl-string-search "\\" tmpDir)))
 (- (vl-string-search "\\" tmpDir (1+ tmpPos)) (1+ tmpPos))))))

 

Is there a way to find the name of the second folder?

 

Is there a way to find the name of the third folder?

 

The string length of the characters for each of the first, second, third (and so on) folders are different, which means I can't count character using the "substr" function.

 

Thanks

KP


Viewing all articles
Browse latest Browse all 1680

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>