File import silent

Hi,
Is there a way for silent import through ComObject/AcX —> Rhino.Application or .Interface ?

So without MsgBox

-Best Regards
Eddi

Instead of running “Import”, run “-Import” - note the hyphen character which suppresses the dialog box.

Does this help?

Dear Dale,
thanks for answer, but are you sure it will work for *.pdf and *.ai import ?

Testet pdf and i have just luck, when i close this “hwnd” through my scripted custom command.
3dm works with your Import3dm example on Github.

Best Regards

Here is a simple RhinoScript example that works (here):

strFile = "C:\Users\Dale\Desktop\Test.pdf"
strCmd = "_-Import " & Chr(34) & strFile & Chr(34) & " _Enter"
Call Rhino.Command(strCmd, True)

This technique will also work in Rhino.Python:

import rhinoscriptsyntax as rs
strFile = "C:\Users\Dale\Desktop\Test.pdf"
strCmd = "_-Import \"" + strFile + "\" _Enter"
rs.Command(strCmd, True)

Hallo dear Dale,
ok I have to ask a question.
I work in Rhino V4, support is out for V4, I understand that.
Does it make sense to ask questions here in forum, with regard to Rhino V4?
I have a lot of fun with RhinoScript, made awesome, but I do not want nervous here with outdated questions!

In V4, it does not work with Enter
And another problem give Msgbox if Import Error occurred.
But it’s not so tragic, solution through hwnd works, but is not so elegant.

Best regards

Even though we no longer sell Rhino 4, we still support it. The problem with Rhino 4 is that if we discover a bug, there is nothing we can do about it because we are no longer developing Rhino 4.

I just tested my sample RhinoScript on Rhino 4, and you are correct, it does not work correctly. This is a bug in Rhino 4’s PDF file import plug-in. Again, there is nothing we can do to fix it. The only think I can suggest is to move to Rhino 5 where this issue does not exist.

Maestro,
Thank you, you’re right, i understand, for vintage Rhino V4 there is no more spare parts. :smile:

I have fixed for myself
Rhino update is on plan, but later, at the moment pure hobby, but very time intensive.

Best regards