Adjust DWG-import-Script from V6 to V7

Hello, unfortunately our script no longer works.

The following line causes problems
Dim strFile : strFile = Rhino.OpenFileName(“Wähle DWG”, “DWG Files (.dwg)|.dwg||”, “dwg”)
Dim strCmd : strCmd = "_-Insert _File=Yes " & Chr(34) & strFile & Chr(34) & " " & “_ENTER _ENTER 0,0,0 _ENTER _ENTER”
Rhino.Command strCmd

The command to insert the File has changed in Rhino7 i think but i can’t get it to work.

Please help
Thanks in Advance
Regards

Hello - this works here:

	Dim strFile : strFile = Rhino.OpenFileName("Wähle DWG", "DWG Files(.dwg).dwg||", " dwg")
	If isNull(strFile) Then Exit Sub
	Dim strCmd : strCmd = "_-Insert _File=Yes " & Chr(34) & strFile & Chr(34) & " _ENTER _ENTER 0, 0, 0 _ENTER _ENTER"
	Rhino.Command strCmd

Does that help at all? If not, what exactly goes wrong? Is there an error message?

-Pascal

Hello, I have found out the problem.
In Rhino7 now the DWG block data including attribute texts are read in.

My problem is that different DWG files have different amount of text attributes.

So I would always need a different amount of “_ENTER” commands in my insert command. I just want to skip the text input query, nothing more.

And I need to read in the DWG as a block, because only that preserves the information of the attribute texts and thus remains usable.

Any Ideas?
Thank You