-
As long as you don't need a reference that is persistent over sessions (closing/restarting of SketchUp), a simple object reference to the active model should be enough. Use active_model only the first time when the user selects a tool for a specific model and then store a reference to it so that it doesn't matter whether the user switches focus before completing the action.
I use for example something like
@@models = { <Sketchup::Model:0x3456> => <MyToolInstance:0x85698>, <Sketchup::Model:0x478043> => <MyToolInstance:0x946932>… }
Does that work for your situation? -
Would ideally require an onActiveModelChanged AppObserver which does not exist. I don't know if someone has any other trick, but the UI focus event seems like a good work-around (although it would not happen in sync with the model focus change).
I don't know if a ViewObserver with a check of view.model would be called too often.
Posts
-
RE: OSX MDI confusion
-
RE: Aborting a .rbz install
Are there no risks when messing around with file deletions?
[If such a method existed] I would prefer to use corresponding API methods for (un)installation, or more generally put:
The same method for uninstallation that was used for installation (by hand, API or EWH).What is the problem of keeping the plugin and just telling the user about the issue. This gives the clearest explanation and the least surprise. Also the user could maybe have reasons to keep the plugin installed without using it actively (like only inspecting how it works, or maybe the plugin folder is synced with another system on which the plugin is supposed to be used). Suddenly disappearing files would rather make a user worried and would blur the line between good software and malware.
Edit: Another thing is: Using ruby to delete files circumvents the trash. If we let the user manage "his" files (that the user installed), there is the chance to restore them.
-
RE: Transforming an object with SketchUp Ruby
You need a reference to the object (of the text). Therefore it is usefule to create the text (edges and faces) inside a group and apply the transformations to the group.
entities = model.entities group = entities.add_group group.entities.add_3d_text("test") group.transform!(tr1) group.transform!(tr2) -
RE: Plugin folder structure renamed in Trimble SU?
Being sold away from Google made SketchUp more free. And in that spirit it sits now in
%(#000000)[SketchUp/SketchUp 2013]. -
RE: Launch Sketchup from inside AOO/LO Draw or Writer?
This is called OLE (Object Linking and Embedding) and is a non-standardized technology from Microsoft. As far as I know, LibreOffice has to some extent support for it, but SketchUp would need to support being embedded. If you try in LibreOffice Insert → Object → OLE object it will tell you that skp files cannot be embedded.
However, you could insert a 2d image that was exported from SketchUp. You can set the inserted image to be just "linked" and it will update immediately every time when the external image file is changed (you have to make sure the linked file is always available, until you break all links). This would fullfill the first requirement to automatically update the image. While you can use the context menu to open the image in an image editor, it is more challenging to make it open the skp model in SketchUp. I tried setting a hyperlink on the image object to
file:///path/to/SketchUp.exe /path/to/model.skpbut it didn't work.
It would be probably better to write a LibreOffice (or OpenOffice or MS Office) macro for that.I think the SketchUp team would rather try to advertize its LayOut for this purpose instead of investing any resources into this.
-
RE: Ruby plugin to standalone application
Without SketchUp you would have no user interface (other than command line).
You can look for graphics UI toolkits that have bindings for Ruby (QT, wxWidgets, Fox, Shoes).
The SketchUp engine can not be embedded, you would have to envoke SketchUp with a (platform dependend) system call and it would open the normal SketchUp application. You can also not easily control it from outside.
• You could use a separate SketchUp installation that has one ruby plugin installed that starts acting when SketchUp starts.
• You could launch a ruby script file when SketchUp starts, using an undocumented command line parameter:-RubyStartUp
• You could use SketchUp Bridge -
RE: [?] Hotkey for softening edges
You can assign the shortcut on your own:
Requirement there is a menu item that "Soften". First select a (arbitrary) edge, then open Window → Preferences → Shortcuts and search for Edit/Entity/Soften to assign a shortcut to it.In your example it makes sense to have two (or more) parallel edges to get better smoothing. Smooth/Soften is not good for acute angles between large faces.
-
RE: SketchUp 2014 Wishlist
Undo scene changes/creations (especially to make plugin actions fully undoable).
-
RE: Erfahrung mit SU 2013
Wahrscheinlich, weil es genauso viel Aufwand gekostet hat wie ein neues Feature. Es ist oft riskant in einem komplexen Projekt Teile auszutauschen, besonders wenn es auf so urig alter Technologie basiert (es sieht nicht nur so alt aus). SketchUp scheint in der "Mikado"-Phase zu sein, vorsichtig jede Verbesserung abwägend, bevor es alles zum Einsturz bringt.
Fehlerbehebungen stehen in keinem Verhältnis mehr zu den Fehlerberichten und viele offensichtliche, "logische" Fehler werden belassen, wie sie sind (wie: gesperrte Gruppe innerhalb Auswahl kann über VCB bewegt werden). Sinnvoll wäre es, beim Planen und (Neu)schreiben solche Fehler zu vermeiden, anstatt später an altem Code herumzufriemeln.
Das Einzige, was Hoffnung gibt, ist dass Trimble das SketchUp Team stetig (monatlich) vergrößert. Es wird also noch was Größeres kommen.
Da die Stabilität etwas zugenommen hat, schadet es nicht zu aktualisieren, ansonsten ist vieles beim Alten. Allerdings für die Pro-Version ist der Preis + Preisanstieg schwer zu rechtfertigen.
-
RE: PRISM?
@unknownuser said:
A confidential classification shows that the NSA considered the Federal Republic as a partner, but simultaneously also as attack target. Hence Germany belongs to so-called third-rate partners […]"
Furthermore, the article says that the NSA has a basis in Frankfurt (a major network junction) to survey 500M connections/month, and not only tapped data that is accessible from outside (cloud companies in the US or sea cables in the Atlantic).
As it seems there is a "war" going on, but nobody has noticed being under attack. All the efforts of cyber war defense (and war on terrorism) have been turned into the opposite, namely attack and compromising of systems and servers worldwide.
So not really a surprise why Edward Snowden's arrestment is pursued at high-speed instead of investigating the constitutional breaches. This needs to be initiated by functioning democratic political institutions, and not only on international pressure.
This is again exemplary for the principles of a sane democracy and separation of powers. If secret services are not included in the balance and control between political powers, they can do what they want. The past decades have shown the USA as the surviving "good" power (which by principle no real combatant can be) of the cold war, and left to them trust and responsibilities that made it too easy to drift away from the right path.
For the future it's probably better not to resist to assign international matters to international institutions (internet, ICANN; UNSC, UNO, etc.).
-
RE: Searching for a Sketchup resizer Plugin!
@unknownuser said:
this somehow doesn't change the aspect ratio
Just set the same value for the minimum and maximum limit, then the width and height will be exactly that size.
-
RE: Lyon en 1700
@unknownuser said:
De ce style Réalité Augmentée ?
Du style réalité virtuelle?

Il faut seulement faire attention s'il y a des ruelles qui n'existent plus

-
RE: My cursor tip icons are flipped
(Not sure if you are the same person…) but Tommy shared a secret trick that they have probably built into SketchUp to work-around the issue. There is a registry key to flip the cursors correct:
%(#000000)[HKEY_CURRENT_USER\Software\SketchUp\SketchUp 2013\Preferences\FlipCursors = 1 (DWORD)]
https://productforums.google.com/d/msg/sketchup/fN_Vp_dx-fQ/Ix-lVoEp0csJ -
RE: PluginStore v1.2 Preview
The plugins store has a full list with dates. If the dates were in a javascript-readable attribute, it could all be done locally by comparing the versions, without changes needed on server-side.
-
RE: Thumbnail preview SketchUp 2013 for mac?
This has been extensively discussed and there is a handful of alternative options/work-arounds:
http://www.sketchucation.com/forums/viewtopic.php?f=18&t=16015
Check them out… -
RE: My cursor tip icons are flipped
There is a difference between Windows versions like 95, 98, Me vs. XP, Vista, 7, 8. The first ones show the cursor the other way round and are unsupported by SketchUp. It is strange that XP 64bit behaves similar.
Does that happen with plugins' cursors as well? Plugins use standard png files instead of the proprietary .cur format, it could be related to that.
-
RE: Error message saying files are not writable
SketchUp 2013 requires a license file no matter whether you have the Pro version (license file contains Pro license key) or the free "Make" version (contains agreement for non-commercial use). While SketchUp 8 tried to make the executables more different to prevent licensing problems, they reverted that and made the executables almost identical, introducing a lot of new problems under certain circumstances (Make turns itself into expired Pro, refuses to run more than 1 instance, or refuses to run as "portable" app).
I assume the above problem was due to user/admin priviledges (in an ideal world, programs would absolutely never request you to run as admin). Strangely the license file is sometimes located at different places, like
Users/Public/AppData/SketchUp/SketchUp 2013/SketchUp13.lfwhich is writeable with simple user privileges. Maybe SketchUp will also find it when you move it there? -
RE: Safe place to store user-defined parameters
- If I understood right, /Library is at system level and the user level (in the SketchUp island ) is preferred in the longterm.
- Not sure why you want the root, but Ruby is so nice and resolves
File.expand_path("/")to root on OSX/and WindowsC:\(or whatever drive letter is root).
So maybe we can crystallize the following choices (?):
when Windows is detected:-
check for
ENV["LOCALAPPDATA"]and use it if available # Vista, 7, 8 -
otherwise check for
ENV["APPDATA"]# XP -
otherwise if both envs are empty, fallback to something (temporary folder, user folder, ignoring or error handling)
when OS X is detected: -
check if plugin directory
File.dirname(__FILE__)is writable and use it
SU2013 in ~/Library/Application Support/SketchUp 2013/SketchUp…
in earlier versions only writable if owned by the user /Library/Application Support/SketchUp 8/…
-
otherwise do what? (question 1, to be determined),
maybe a subfolder ofFile.expand_path("~/Library/Application Support/SketchUp"), did this location change with the transition to Trimble?
otherwise (when platform detection fails) -
check if plugin directory is writable and use it
-
otherwise fallback (temporary folder, user folder, ignoring or error handling)
Another question 2 is whether to put the plugins folder at highest priority if it is writable? This would make it simpler and more consistent, it would be prepared for when SketchUp moves plugins into user level on Windows, and makes plugins "self contained".
-
RE: Safe place to store user-defined parameters
As for the flags, I think they are an OS X feature and created after extracting the zip file (zip files have only a very primitive internal file system).
-
RE: Safe place to store user-defined parameters
What speaks against using an iterative search?
# Find an existing and writable directory where to store user data. dir = [ ENV["LOCALAPPDATA"], # Windows ver. 6+ ENV["APPDATA"], # Windows File.join(ENV["HOME"].to_s, ".local", "share"), # Free desktop standard File.join(ENV["HOME"].to_s, "Library", "Application Support"), # OS X "." # Fallback; exists always, where as ENVs may not. ].compact.map{ |path| File.expand_path(path) } # expands links and path separators .find{ |path| File.exists?(path) && File.writable?(path) } DATA_DIR = File.join(dir, "MyPlugin")