Dynamic Component lose attributes


#1

Hi all

When inserting dynamic component via ruby script he lose some attributes.
Why ?
I create a component, save it as skp file, and import it from ruby script. Result is shown on first screenshot. (they should be present x,y,z attributes)
When inserting via component tray, component looks correctly. result on second screenshot.
Any idea what may i am doing wrong?

i notes also then when i inserted second instance first get his attributes correctly.


#2

Hi again.
Any suggestion?
Should i read something or this is well known problem?
I believe I missing something simple but i cant figure what.
Problem is that i create more complex components that loose important data when inserted via ruby srcipt.

Best regards


#3

It might have something to do with the level of ‘wrapper’ . By importing from the components tray, the components get’s ‘wrapped’ and displays the DC Attributes, with the one created on the fly the attributes are one level up (Model) and can’t be seen directly (only when imported into another file)
@pcmoor ?


#4

I think we need to look at your ruby script in part in regards to this action


#5

Ruby script is trivial and basically is copy of example from API side.

point = Geom::Point3d.new 0,0,0
transform = Geom::Transformation.new point
model = Sketchup.active_model
entities = model.active_entities

path = "c:/blok.skp"
definitions = model.definitions
componentdefinition = definitions.load path
instance = entities.add_instance componentdefinition, transform

When i will be back home i will send exact method definition. But i would not be very different.
I would like to confirm or deny such behavior on anyone else.


#6

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.