Export By Layer And ExportWithOrigin

Hello Everyone,

I am quite new to Rhino and I am certainly not a very good scripter.

I need to export a projet by layer to the SAT format. I used this script that I found here :

It works perfectly except that my files are not georeferenced anymore. So I tried to replace the command “Export” with “ExportWithOrigin” but there is a problem. Unlike the first script, it doesn’t recognize the “strFile” to export and save the file… so it asks me that :

“Enregistrer le fichier sous ( Version=5 EnregistrementCompacté=Non GéométrieUniquement=Non EnregistrerTextures=Non EnregistrerDonnéesModules=Oui Parcourir ):”

Which means “save as …”. and the ask me for a file path and a name. Which is given in the script. This simple change is ruining my worklfow…

So I Wonder is anyone already had such a problem and is there a solution (I tried for hours) ?

To be tranparant here’s my script ( it’s the same than the one earlier but we never know…):

Thank you !

Hi @Timothee_Holla,

The ExportWithOrigin command, you need to specify the origin as a 3-D point before specifying the file name.

For example, if you wanted the exported origin at 5,5,0, you could do this:

Rhino.Command "_-ExportWithOrigin 5,5,0 " & strFile & " _Enter", 0

Does this help?

– Dale

1 Like

Hi @Timothee_Holla, @dale,

the _ExportWithOrigin command only works for *.3dm files.

c.

Hello @clement and @dale,

I tried with 3dm and dale’s correction in the enventuakity that it’s not possible with sat.

But i feel the script doesn’t understand Something (more likely i don’t)…

Because before asking me the origin it reads the strFile as the input for the origin. So it says “unkonwn command : C:…blabla”. And it re asks me the origin and the the strFile.

So I would like a way to force the origin and then the strFile name.in that order.

And @dale for some reasons when i write exactly the same thing than you It doesn’t even consider the export fonction.

So i am lost… haha.

I tried to define a new variable “origin” but it doesnt work either…

Hi @Timothee_Holla,

Review the attached script and let me know if any any lightbulbs turn on. :wink:

– Dale

ExportLayerObjectsWithOrigin.rvb (1.9 KB)

Hey Dale,
Sorry for the late response, I was in holidays for a few days (French you
know… haha).

It just tried your routine, it seems to work perfectly! I really thank you
:).
I am so happy right now!

Thank you!

Hi, Timothee,

Could you tell me how to input the strPath? I tried as follows, however, it replies some problem.

strPath = Chr(34) & D \ Users \ PythonZhou \ Desktop \ 1.3dm & Chr(34)

Looking forward to your help.

Hi,

I’m not so the RhinoScript expert, but shouldn’t your code rather look like this:

strPath = Chr(34) & “D:\Users\PythonZhou\Desktop\1.3dm” & Chr(34)