Hello dear Rhino community,
I am working on the automation of the following task. My task is to create a rhino command which sequentially opens defined list of .3dm files. For each file it finds specified named view (layout) and print it to the .pdf file.
I am using C# and I manage to do it. However, there is this issue I would like to solve. I use
var newDoc = RhinoDoc.Open(file.Key, out wasOpen);
to open new file. It works but with one complication. It always ask if I would like to save file which is being closed. For 20 files, I need to sit in front of my PC and always clicking no.
So my questions are:
Is there a way how to suppress this save dialog in Rhino?
Is it possible to do suppress dialog programically or programically press keys “N” and “Enter”?
Is it possible to open .3dm files headless? I did try RhinoDoc.OpenHeadless()
but there is apparently a bug and views have always default settings. RhinoDoc > OpenHeadless > .3dm file - #7 by Rama_Shashank
Is it possible to do same task with File3dm
class? I did also try but I can only get ViewInfo
class and not View
.
Thank you for all your replies and time.
Ondřej
Hello @farouk.serragedine thank you for the reply.
I am civil engineer so my coding skills are not so high. Can you please describe more your code?
In which part I should insert your code? Does it close only .3dm file or whole Rhinoceros? I do not want to close whole rhino, only close and open new file.
Thank you
Ondrej
Actually I just understood that you’re not using RhinoInside.
The solution posted above was targetted for rhinoinside (allows you to open files from an external application). If that is a plugin that works within Rhino obviously my solution wouldn’t work, it’d close your rhino window.
Sorry for the missunderstanding !
No problem.
RhinoInside is here probably better solution (external app). Actually, RhinoInside was my first choice. I tried to use GitHub template for RhinoInside console app. It ended with error that RhinoLibrarry.dll cannot be loaded. I haven’t time to solve it yet so I turned to RhinoCommon…
Do you have experience with RhinoInside?
Thank you
Could you describe your application scope and provide a sample 3dm file?
If it’s simple I can make a script for you using RhinoInside.
Really? That would be awsome.
Application scope:
- Application/command which opens defined number of .3dm files and read defined layouts (drawings prepared for printing) and print them to PDF.
- Before printing few commands will be applied (this is optional as drawings should be already prepared for printing)
- If possible, same should be done with .rws files.
Sample file is below with layout called 205_005_VPR
205_005_VPR.3dm (1.2 MB)
One more question. Do you have experience with RhinoInside Excel? I have issues, which I was not able to solve as well.
Thank you
Ondřej