Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP for converting to STB

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
bouwenb
532 Views, 4 Replies

LISP for converting to STB

Hi all,

 

I want to create a LISP file to convert drawings from CTB to STB.

This can be done by the follwing command:

(command "convertpstyles" "xxxxx.stb")

 

My problem is that I can only specify .stb files that are located in the plot file table search path (in my case this is "C:\Users\xxxxx\appdata\roaming\autodesk\autocad 2012 - english\r18.2\enu\plotters\plot styles").

I can not specify an .stb file that is located in another folder, or even in a subfolder of the search path.

 

Is there a way of specifying the full path of the .stb file in the Lisp call?

 

I've tried the following, but without succes:

(command "ConvertPstyles" "c:/Users/...../plot styles/STB files/Conv2STB.stb")

 

Thanks

4 REPLIES 4
Message 2 of 5
dicra
in reply to: bouwenb

If your file is located in "C:\Users\xxxxx\appdata\roaming\autodesk\autocad 2012 - english\r18.2\enu\plotters\plot styles\STB files\Conv2STB.stb"

 

I think that you need to start location from folder which is in "plot styles"

 

(command "ConvertPstyles" "STB files/Conv2STB.stb")

 

Message 3 of 5
bouwenb
in reply to: dicra

Hello,

 

your suggestion works, my drawings get converted from CTB to STB!

Thanks!

 

I wonder though if there is a way to acces .stb files that are located in a different folder (not a sub folder).

For example, if my .stb file is placed in the folder C:\ACAD\plot styles\Conv2STB.stb is there a way to acces this file through the LISP command (without having to add this folder to my plot style table search paths)?

Message 4 of 5
dgorsman
in reply to: bouwenb

Your LISP could modify the search path, do the operation, then restore it.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 5 of 5
dicra
in reply to: bouwenb


@bouwenb wrote:

Hello,

 

your suggestion works, my drawings get converted from CTB to STB!

Thanks!

 

I wonder though if there is a way to acces .stb files that are located in a different folder (not a sub folder).

For example, if my .stb file is placed in the folder C:\ACAD\plot styles\Conv2STB.stb is there a way to acces this file through the LISP command (without having to add this folder to my plot style table search paths)?


bouwenb

 

I hope this is not to late for you,

 

I did not test this, but I think that you suppose to do something like this:

 

(setq oldpath (getenv "PrinterStyleSheetDir"))

(setenv "PrinterStyleSheetDir" "your path")

(command "ConvertPstyles" "Conv2STB.stb")

 

if you like to return old path:

(setenv "PrinterStyleSheetDir" oldpath)

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost