π’ PlaceMaker | 25% off for February including new Google Earth data imports!
Learn more
Get/Set Image and Group glue_to ?
-
ComponentInstance
has.glue_to
- butImage
andGroup
does not despite that they can be glued.
AndFace
has.get_glued_instances
which does list Images and Groups attached.Is there a workaround to glue or unglue
Image
orGroup
entities 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 end
Now 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.
Advertisement