Thank you TIG,
I understand the concept - and will let you know how it goes.
T
Thank you TIG,
I understand the concept - and will let you know how it goes.
T
Martin says this is the best newbie forum on Earth!
http://www.martinrinehart.com/models/tutorial/tutorial_toc.html
Although I can't consider myself a complete newbie - transformations make me feel that way:
I'm trying to add a face entity to an existing group nested within a
component instance. The model structure looks like this:
model > dynamic component instance > group
I'm trying to add a new face to the nested group through Ruby. There
is no edit context when the ruby tool is initialized.
the code:
#@ip2,@ip3,@ip4 are input points defining three corners of the
rectangular face
#@ptCalculated is the fourth computed corner of the rectangular
face
#@spacegroupdef is the existing group inside a DC instance
#put the rectangle in a group temporarily so the face and 4 edges
can be transformed as a unit
bumpgroup = @spacegroupdef.entities.add_group
bumpgroup.name = "temp bumpgroup"
#insert the new face
face1 =
bumpgroup.entities.add_face(@ip2.position,@ip3.position,@ip4.position,@ptCalculated)
trans_array = Array.[](1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)
#first, rotate - no rotation required
#second, scale
trans_array[0]= trans_spacegroup.inverse.to_a()[0]
trans_array[5]= trans_spacegroup.inverse.to_a()[5]
#If the transform! is conducted at this time, the scaling is
correct
#I'm sure the input point comes from within the existing face that
is in the nested group
trans_array[12] = -(@ip2_transformation.to_a()[12]) #Xt
trans_array[13] = -(@ip2_transformation.to_a()[13]) #Yt
new_transform_2 = Geom::Transformation.new(trans_array)
bumpgroup.transform! new_transform_2
The translation executes but it is not correct.
I have tried using two separate transformations in different orders.
First scale, then translate as above with the same result.
Also first translate, then scale. In this case the translate works,
but after applying the scale I get incorrect results.
Not sure where I am going wrong. Any ideas about what I need to do to
get the X and Y translation correct?
Kind thanks!
Thank you for the review. You understand correctly and have verified what I was not sure about.
I wanted a face to be created across sub components but it seems the face will only be created if the edges are in the same subcomponent.
I will try to reform the component using rectangles to achieve the result I want to have.
Thanks again for your input!
I've attached the component - I appreciate your time and effort!
Is there a way to "fill" a list attribute dynamically? This would be useful for an attribute that has many possible values or one that has values that change periodically.
Could the list attribute be filled from a ruby script that reads values from a file or an array?
Thanks!
I have created a dynamic component that dynamically sizes edges of an 8 sided irregular polygon. I do this by creating 4 sub-components containing edges of the polygon that can change. It works fine.
The edges always create a closed loop on the same plane and I want to retain the face in my component that is created from the edges but I can't figure out how to keep it in my component. Either:
Has anyone solved this problem or can offer insight?
Thanks!