PDA

View Full Version : c:3dsout error


Peiman
26-09-2008, 11:16 AM
I've tried to export 3ds file using c:3dsout external function but it raised an error :

"incorrect type for parameter 5"

which refers to the filename. Although for the first time it worked and exported the file but then it failed to export. even restarting autocad and deleting the exported file didn't changed anything, and it couldnt run the same code again.

my code was :
(setq ss (ssget))
(c:3dsout ss 0 2 30 0 "a.3ds") or (c:3dsout ss 0 2 5 0 "e://a.3ds") or
(c:3dsout ss 0 2 5 0 "e:\a.3ds")

Alan Cullen
26-09-2008, 11:32 AM
Dunno if this helps....but the first thing you have to do is set up a name for your file wihin the parameters of lisp.....sorta like this.....

(setq dwgpath (getvar "dwgprefix"))
(setq input (getstring "\n Enter name of input file (include extension) : "))
(setq input (strcat dwgpath input))
(setq fname (open input "r"))

CarLB
26-09-2008, 06:55 PM
Per the reference the syntax is:
(c:3dsout sset omode div smooth weld file)
and their example is:
(c:3dsout (ssget "X") 0 0 30 0.1 "testav.3ds")


Paramater 5 is the welding distance, and is a "real number". Your syntax all looks pretty good. Just a guess, maybe "0" should be "0.0" so it is more strictly in real number format.

Peiman
27-09-2008, 05:35 AM
I've tried using a file variable instead of string but it gave another error :
Incorrect type or data overflow

CarLB, Are you sure parameter start number is from 1? I've thought the first index is zero. Although I have tested real number but the error remained.

CarLB
27-09-2008, 06:26 AM
No I'm not sure..

but looking at your directory-file format I think you have slashes backwards, should be single forward slash or double backlslash.