Get/Set Image and Group glue_to ?
-
ComponentInstancehas.glue_to- butImageandGroupdoes not despite that they can be glued.
AndFacehas.get_glued_instanceswhich does list Images and Groups attached.Is there a workaround to glue or unglue
ImageorGroupentities using the API? -
class Sketchup;;Group def real_parent if self.entities.parent.instances.include?(self) return self.entities.parent else Sketchup.active_model.definitions.each{|definition| return definition if definition.instances.include?(self) } end#end return nil # Should not happen. end end class Sketchup;;Image def real_parent if self.entities.parent.instances.include?(self) return self.entities.parent else Sketchup.active_model.definitions.each{|definition| return definition if definition.instances.include?(self) } end#end return nil # Should not happen. end endNow use these to find the 'component-instance' of a group/image - e.g. of say the group you want to 'unglue'...
group.real_parent.instances.each{|ins| if ins == group ins.glued_to = nil break end#if }I haven't tried this but something like it should work...

EDIT: tried it it fails !

-
see new beta post, SKX forum:
[code] beta Group/Image parent, glued_to? etc.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement