Salut,
Les plugins (en rbz) installer via prĂ©fĂ©rence/extension peuvent ĂȘtre activĂ©s Ă la volĂ©e, mais ne peuvent pas ĂȘtre dĂ©sactivĂ©s ensuite Ă la volĂ©e (nĂ©cessite le redĂ©marrage de SU).
Salut,
Les plugins (en rbz) installer via prĂ©fĂ©rence/extension peuvent ĂȘtre activĂ©s Ă la volĂ©e, mais ne peuvent pas ĂȘtre dĂ©sactivĂ©s ensuite Ă la volĂ©e (nĂ©cessite le redĂ©marrage de SU).
I thought this topic was used to identify inconsistencies in the API doc.
I had just noticed that the code of the tutorial was a mistake.
I started in ruby but I think the line "value = value.gsub(/'/,''')" contains an error.
Maybe I'm wrong and that it is normal that the two following functions can be found commented.
So TIG you say it should be .gsub(/'/,"'"). That's what I wanted to know and get noticed.
Sorry for the inconvenience.
Hi !
I haven't seen if it had benn reported but :
In Attribute reporting Tutorial in the function :
def clean_for_xml(value)
value = value.to_s
value = value.gsub(/\</,'<')
value = value.gsub(/\>/,'>')
value = value.gsub(/\"/,'"')
value = value.gsub(/\'/,''')
return value
end
The last gsub make that the rest of code is a comment...
Niquel ton composant Silic !
Super la possibilité de choisir si on peut redimensionné avec l'outil échelle.
Par contre j'aurai rajouté l'étape "complÚtement fermé". Et pourquoi pas pouvoir agir sur chaque vantaux.
@Vick : Normalement la version pro ser uniquement Ă "programmer" un composant. Un utilisateur avec la version non pro peut interagir avec un composant dynamqie.
Essayes : clic droit sur le composant, composants dynamique, options du composant.
Ok, I need some times to understand what you say.
But... Why I can't get the information that I see in the DC attribute window ?
Then in the DC attribute window the information is update automatically...
How the feature File/Generate rapport do that ?
Ok for the time being my aim is to get the angle of my DC.
In the DC dialog window roty = 17.
With my code I get 0.
Ohhh, I get news
So I entered directly the angle in the DC dialog window
and now the angle appears in the ruby console !
But if I move the DC with "move" or "rotate" the angle change in the window but no in the return of my code.
Why ?
You speak about transformation... did i get my angle with other method than attribute_dictionaries ?
Ok I don't understand something...
In my model, I create a "cube" and make it DC (manually).
I rotate (Y axe) it (manually).
I type your code in ruby console and run it.
Return nil
I display in attributes component window : x,y,z,lenx,leny,lenz,rotx,roty,rotz.
I run again your code.
It return each pair key and value
With my model who have my DC,
Your code return just
"_has_movetool_behaviors"
1.0
and the two personnal key/value
But in the attributes component windows all the key and value are displaying...
In fact, with my code, I can get name, _lengthunits, lenx,ley,lenz. But x,y,z,rotx,roty,rotz, return 0
Thanks TIG for your reply.
Yes, entites[0] is a DC instance.
It was a simplified example, in my whole code I have different "test" to be sure that is a DC instance.
And in the same examaple with only one DC :
entity.get_attribute("dynamic_attributes", "lenx")
return a value > 0
I have tested with _inst_roty
return nil
Hello !
Sorry for my poor english...
I will get the value RotY of DC's dynamic_attributes.
But in my code :
model = Sketchup.active_model
entity = model.entities[0]
roty_1 = entity.get_attribute("dynamic_attributes", "roty")
roty_2 = entity.definition.get_attribute "dynamic_attributes", "roty"
puts roty_1
0
puts roty_2
0
Why get I zero ?
It must be 30...
Any idea ?