Help with opening additional instance of SketchUp.
-
Now that I have figured out the correct path\filename, it works great. Will it work with OSX?
-
@honoluludesktop said:
Now that I have figured out the correct path\filename, it works great. Will it work with OSX?
With MAC you might need to adjust the code slightly... try something like
UI.openURL("file:/path/to/model.skp")
with forward slashes [/
] and the extra leading 'file:/
' - note that that might also work on PC too... -
This is interesting, If the app is written with the ruby method
system
, the original model will not update until the second instance of SketchUp is closed. By usingUI.openURL(path\filename)
a message box (or some other means) must be used to stop processing the app on the first instance of SketchUp. While the former is safer, the latter allows viewing the whole model while editing the selected component. -
On Mac.. an additional Sketchup instance is not needed as the Mac edition is a tabbed MDI (Multiple Document Interface.) So using the API method Sketchup.open_file you should be able to have your plugin edit the component file in a new model tab.
I did log requests for several new methods for MDI use such as a close_model method, along with appropriate observers. If more coders ask for these in the API Wish list forum, perhaps their priority will be raised.
Additional topic threads on this subject:
[Wishlist] Edit Component
[HowTo?] Edit Components (or change "active level") -
@unknownuser said:
If you are just trying to avoid blocking you could use
system("start process") as start returns immediately. -
@honoluludesktop said:
system ("start C:\Program Files\Google\Google SketchUp 8\SketchUp.exe")
Avoid spaces between method name and brackets.
Of all your different versions to call it, have you tried adding quotes around the path to SketchUp?
-
My original code,
system file_path_name+name+".skp"
starts a second instance of SU, suspending the first. I tried every combination of:system("start"+file_path_name+name+".skp") system(start file_path_name+name+".skp") system(start,file_path_name+name+".skp") system ("start C:/Program Files/Google/Google SketchUp 8/SketchUp.exe") system ("start C:\\Program Files\\Google\\Google SketchUp 8\\SketchUp.exe") Thread.new {system ("start C:\\Program Files\\Google\\Google SketchUp 8\\SketchUp.exe")}
etc. and, couldn't start sketchup, with or without, a parameter.
system ("start command")
however, will open the cmd window without suspending the first instance of Sketchup. What could I be doing wrong? -
No, I'll try those too.
-
This worked:
system('start "New SketchUp Window" "C:/Program Files (x86)/Google/Google SketchUp 8/SketchUp.exe"')
I looked at the help information for
start
:
Turns out the first argument must be a title - for that command window that briefly flickers.
Not sure if this works under OSX though.
-
OK, now I have, but to no avail. Will comeback and try later, just have to go and eat some breakfast.
Addenda: posted without seeing yours. Thanks.
-
Thomas, Thanks, it too works for me. Don't think that I would have thought to enclose the set of parentheses in another enclosing parentheses.
system("C:/Program Files/Google/Google SketchUp 8/SketchUp ")
will start without specifying ".exe", or splashing a cmd window. So, that may work with OSX. But excluding ".exe" insystem('start "process......."')
fails to start. I think (for now) that I will stick with starting the second instance of SketchUp withUI.openURL('process.....')
. Don't know if that works with OCX. In Win, however, Sketchup appears to start faster, but don't know about the overhead.I see that your version of DOS is 6.1. Is this its original release, or the one that came with your WinOS? Which machine were you on at the time? I have a copy of DOS 6.1 (left over from the good old days) installed in a VPC.
-
The paths to Sketchup.app on OSX, and Sketchup.exe on Windows, are different.
-
@honoluludesktop said:
I see that your version of DOS is 6.1. Is this its original release, or the one that came with your WinOS? Which machine were you on at the time? I have a copy of DOS 6.1 (left over from the good old days) installed in a VPC.
FYI ... DOS 6.22 came out at the same time as Win 3.11 for Workgroups (I still have my disks and manuals as well.) DOS 7 was distroed with Win98 (not sure about Win95.) Win 2000 & up are NTFS not DOS.
BUT ... you misread the image. It is the Windows ver that is displayed, not DOS.
Win 5.0 = Windows 2000
Win 5.1 = Windows XP
Win 6.0 = Windows Vista
Win 6.1 = Windows 7
Advertisement