- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
My flow chart is basically like this - ask the user for which kind of drawing he/she wants and then which sheet size. Accordingly, this kind of drawing setup and sheetsize shall be created by using layers > template and grabbing it from an existing file that has the desired layouts put.
One issue I have is that when I am proposing a (setq) to be a path to the existing dwg file, the program somehow cuts out my "/" and/or where there are spaces. Any way around this problem?
The code is pretty much like this (+ a "main program" to run the functions accordingly):
(defun inserttab ( / )
(setq filnavn "C:\Users\myuser\Desktop\import.dwg") ;;dwg path?
(cond
((and (= tegning "B")(= arkstr "A1"))
(progn (setq lnavn "BA1")
(arkimport)))
((and (= tegning "B")(= arkstr "A3"))
(progn (setq lnavn "BA3")
(arkimport)))
)
)
(defun arkimport ( / )
(command "layout" "t" filnavn lnavn)
(command "layout" "set" lnavn)
(command "zoom" "extents")
(print (strcat filnavn " " lnavn))
)
(defun typetegning ( / )
(setq tegning
(progn (initget "B C1 C2 F U")
(getkword "Which kind of drawing? [B/C1/C2/F/U]:"))
)
(print tegning)
);_ defun
(defun sheetsize ( / )
(setq arkstr
(progn (initget "A1 A3")
(getkword "Which sheet size? [A1/A3]:"))
)
(print arkstr)
);_ defun
I believe the problem is relating to the (setq filnavn)-path, because when i ask the program (! filnavn) it cuts out some parts of the link.
Solved! Go to Solution.