Hi I would like to ask you if i can change the definition value from the component attribute
Regards Kostas
Hi I would like to ask you if i can change the definition value from the component attribute
Regards Kostas
I assume you mean the definition name. If so, you cannot, however you can reset the “_name” using the animation and set function. Its most likely you are using OCL, so, you can use the “Name” attribute and expose it easily in OCL or use some attribute and expose that using the inbuilt ruby functions in OCL.
Alternative can use a ruby script to search and rename to next available component name.
Please explain further and give example(s) or what you want to acheive
Hi Thank you for your reply What I want is this: I have a DC plastic leg for cabinet box with different height dimensions 7,10,12,15cm and I would like this dimension to be imprinted on the OCL
For example if i have a leg 7cm on the OCL appear Leg 7 or Leg 10 etc without to correct myself
I made some test and i notice that what is written in the definition is also written in the OCL.Thats why i want to change automatically. I have many components with this situation so it’s very important to me to acheive this
Rather than build own, could you post a DC cabinet with the leg, so can use the ruby method in OCL to report the size. This way can produce result that you are familiar with, own language for attributes.
This could be the “Name” or other attribute you want to list
Hi Sorry about that but what is the ‘ruby method in OCL’?
Look at Overview to see report,
this would then apply to all designations, whereas only need for leg.
component definitions should be generic, with the “Name” attribute specific
like leg, then the Name attribute = _name & “ “ & length
Name can be exposed in leu of component definition
Please upload your Cupboard DC with leg as a subcomponent, then I can put a condition to suit
need sleep now, tomorrow will do
Thank you so much pcmoort Just i change the general param it’s all i need
Thank you Kostas
hi Sorry about that but now i get the name of component but i want to get the definition name of the component in the designation field on the OCL and the description field ont the component attributes
look the img
Regards Kostas
To show the data you want on the parts list you would use the “Name” attribute and click option as above. Then use formula in the DC attribute dialog similar to..
Name =”Leg ” & choose(int(lenz)-5,7,7,10,10,12,12,15,15,15)
Again, I ask for a DC so can build formula to suit, otherwise its guess and error.
The downside with having a multi sizing DC Component with sub DC parts is Uniqueness, in that they will be listed separately not a total (leg#1, leg#2..). So, to overcome consider separate non-DC components leg 7, leg 10, leg 12, and leg 15; to be slightly stretched within their range and visible dependent on lenz. Unlike the Sketchup report, OCL does not report hidden components, groups or cutting components.
Hi pcmoor Have a nice day Now for the OCL ok i will see it , but can you help me to put the definition name in the DC attribute description ? If i solve this it will be just fine
Kostas
you can use _name
description =_name & " " & lenz
Where “_name” is a hidden persistent attribute that takes the first definition name
to set “_name” if not what you want, or you changed the original definition name, use
onclick set("_name", "my new name")
where “my new name” is what you want, this will update the attribute and option dialog headers. once change then can delete onclick
Let me more specific Supose to create a new DC with the ‘comp1’ first name so the definition name in entity info it will be the same ‘comp1’ and if i use the ‘_name ‘ in the DC attribute description i will get the first name which is ‘comp1’ so far so good ,now , if i will change the definition name in the entity info like ‘comp2’ , the first name will continue to be ‘comp1’ and if i will use the ‘_name’ in the description i will take the first name ‘comp1’ and not the ‘comp2’ Now all i want is to take the definition name, now what is the formula must use to take the second name
Dynamic Components is a ruby extension. So, there is a gap in updating items to Sketchup. OnClick is a method to update “_name”.
Another way to show information is the instance name, this will automatically update the option and attribute dialogs provided the “Name” attribute is not used ("Name” overrides instance, same with manual change of attribute dialog title) So generic component definition “leg” with instances “7 ,10, 12, or 15” may be okay. For DCs the component has to imported or dropped for instances to initially engage.
As @pcmoor explains part length can be easily added in DC name.
And OCL can use this DC name by enabling the relative option.
Else, from the OCL export module, you can access at any DC attribute with ruby function .get_dc_attribute(…)