Yes -that jogged my memory - attachEvent was the IE way. (imagined that later IE (IE7 or IE8) used addEventListener as it's part of the DOM standard. But maybe I was wrong. ...or maybe it depends on the doctype....
sorry, I must be really tired today. I meant you can't use a pickhelper outside of the current context. so If you you have two instances in the model, and you double click one, you can't use the pickhelper on it's sibling.
class EntityObserver
def onChangeEntity(entity)
puts entity.to_s + " changed"
end
end
$entityObserver = EntityObserver.new
def addObserver
Sketchup.active_model.selection.each{|entity| entity.add_observer($entityObserver)}
end
def removeObserver
Sketchup.active_model.selection.each{|entity| entity.remove_observer($entityObserver)}
end
If you have one entity selected, it adds and removes fine, but if you have more than one entity selected, it only removes the first entity in the selection.
Not sure if this is what you want to do...
Select the component, context-click and [Save as], save it to a folder as a new component file.
Open the saved file, [select all] - [Cut] - [Paste]
Now your cursor is at the corner of the new volume, click at the origin point and paste it there. Save the file and close it.
Go back to the file you were previously working on, context-click the component and [Reload], select the saved component file and you're done. Everything your component had as its definitions should be inherited to the reloaded component.
Well, I haven't had many replies, although I do have another question.
When you use ASP in the web dialog, as far as I can tell, the ASP post-back doesn't work. I've gotten it to work in the development server. Do I need to use javascript post-back, or am I just missing something?
Is there any way to find the opposite face of a rectangular block without using a raytest?
I made a function in my Selection Toys plugin that selects the opposite face. Doesn't use ray testing though. I lops over the connected geometry and finds the nearest opposite face. You can poke around in the code for that if you like.