Visual LISP, AutoLISP and General Customization

Reply
Active Member
bouwenb
Posts: 9
Registered: ‎06-07-2010
Message 1 of 5 (204 Views)
Accepted Solution

LISP for converting to STB

204 Views, 4 Replies
01-29-2013 12:13 AM

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

Valued Contributor
dicra
Posts: 63
Registered: ‎02-20-2011
Message 2 of 5 (194 Views)

Re: LISP for converting to STB

01-29-2013 01:08 AM 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")

 

Active Member
bouwenb
Posts: 9
Registered: ‎06-07-2010
Message 3 of 5 (190 Views)

Re: LISP for converting to STB

01-29-2013 01:34 AM 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)?

*Expert Elite*
dgorsman
Posts: 5,044
Registered: ‎10-12-2006
Message 4 of 5 (170 Views)

Re: LISP for converting to STB

01-29-2013 07:39 AM 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.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


Valued Contributor
dicra
Posts: 63
Registered: ‎02-20-2011
Message 5 of 5 (141 Views)

Re: LISP for converting to STB

02-01-2013 05:49 AM 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)

 

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community