Reactions in Powercopies with Stabile Geometry.pdf

(244 KB) Pobierz
Log in / create account
article
discussion
edit
history
Reactions in Powercopies with Stabile Geometry
Contents
[hide]
1 Generative Reactions in the Tree
2 Reactions Basics
3 Why can't I build on the points?
4 Outputted Geometry vs. Deleted Geometry
«««
(?)
Generative Reactions in the Tree
Using reactions and powercopies, it is possible to create smart components that are truly
generative.
[edit]
One may create powercopies with a variable number of nested userfeatures or powercopies
using either lists/loops or reactions. The following article describes how to use reactions to
create a parametric set of components, but also to create stable elements in the set that you
can use to build on.
[edit]
Reactions Basics
For an explanation on how to establish the initial reaction setup, check out the
Reactions in
Powercopies
article.
If a user created a reaction-based loop, like the example in the
Reactions in Powercopies
article, there exist only two ways to use that geometry produced by the loop:
1.) Visual Confirmation -- The dots cannot have children, because the loop deletes them.
2.) Use More Programming -- Add to the VB script to include more information.
Why can't I build on the points?
[edit]
Structurally, the reaction procedure deletes old construction geometry and userfeatures, builds
new construction geometry, and instantiates new userfeatures. If a user builds on those
elements, i.e. putting one sphere on one of the points, when the Reaction deletes the parent
geometry, Digital Project must orphan the sphere.
That user, if knowledgeable with Digital Project scripting, can go back into the Reaction and
add the sphere into the programming. Scripting is not a prerequisite to use reactions, and with
some clever templates, it is possible to "Publish" some geometry so that it is not affected by
the deletion process.
[edit]
Outputted Geometry vs. Deleted Geometry
Using the framework from the
Reactions in Powercopies
article, there exists one singular set
for exporting the dynamic elements, PT_RESULT. This container will change with every
activation of the Reaction. If the division is 3, the script will returns three new points in place of
the old count.
In the
new test file
there are two output geometrical sets:
PT_RESULT
PL_RESULT
These sets have been segregated to handle two different operations, Deletion and Removal, respectively. PT_RESULT will collect the
dynamic elements and will always be in flux. Trying to model with those pieces will result in update errors, unless you program more
geometry.
PL_RESULT will collect elements that have the ability to stay there no matter what their condition is.
This case
will use one polyline, and
that polyline with exist whether it has control points or not. It is imperative that the user not add any Update objects into the VB code.
Updating a non-pointed polyline will create an error.
The procedure for polyline modification is through its
.removeElement
suffix in the VB code. The "PL_1" polyline will remain and with the
converted by Web2PDFConvert.com
update of the reaction, be assigned new input points from the PT_RESULT set.
Make sure to put all child geometry into the "FollowingGeom" Geometrical Set.
The following is the entire code, with comments, of the VB reaction hung on PT_RESULT. The outputted (or "Published") elements is in the
PL_RESULT set.
Dim LoopNum as Integer
set current = MechanicalFeature
found = false
While found = false
set Current = Current.parent
If TypeName(Current) = "Part" then
found = true
end if
wend
set CurrentParams = Current.Parameters.Sublist(MechanicalFeature,true)
For LoopNum = 1 to CurrentParams.count
If instr(CurrentParams.item(LoopNum).name,"NUM_PTS") then
CurrentNum = CurrentParams.item(LoopNum).value
elseif instr(CurrentParams.item(LoopNum).name,"SpacingDim") then
CurrentNum2 = CurrentParams.item(LoopNum).value
else
end if
next
'------------REMOVE POLYLINE POINTS FIRST-------------
dim PLine1 as HybridShapePolyline
set PLine1 = MechanicalFeature.parent.item("PL_RESULT").hybridshapes.Item(1)
For LoopNum = 1 to MechanicalFeature.parent.item("PT_RESULT").hybridshapes.count
PLine1.RemoveElement 1
next
'------------DELETE THE POINTS NEXT-------------
For LoopNum = 1 to MechanicalFeature.parent.item("PT_RESULT").hybridshapes.count
set CurrentRef = Current.CreateReferenceFromObject(MechanicalFeature.parent.item("PT_RESULT").hybridshapes.item(1))
Current.HybridShapeFactory.DeleteObjectForDatum(CurrentRef)
next
Set CurrentCurve = MechanicalFeature.Parent.Item("REFERENCE").HybridShapes.Item("CURVE")
Set CrvRef = Current.CreateReferenceFromObject(CurrentCurve)
converted by Web2PDFConvert.com
Set ShapeFact = Current.HybridShapeFactory
'------------ADD THE NEW POINTS------------
For LoopNum = 1 To CurrentNum
Set hybridShapePointOnCurve1 = ShapeFact.AddNewPointOnCurveFromDistance(CrvRef, (LoopNum-1) * (CurrentNum2 ), true)
hybridShapePointOnCurve1.name = "PT_" & LoopNum
MechanicalFeature.parent.item("PT_RESULT").AppendHybridShape hybridShapePointOnCurve1
Next
'------------RECONNECT THE POINTS WITH THE POLYLINE------------
For LoopNum = 1 To CurrentNum
set LXInnerPoint2 = Current.CreateReferenceFromObject(MechanicalFeature.parent.item("PT_RESULT").hybridshapes.item(LoopNum))
PLine1.InsertElement LXInnerPoint2, LoopNum
Next
End sub
Media:SMARTDIVIDE_w_Polyline_newPowercopy.zip
Categories: Best Practices
|
Knowledgeware
|
Knowledge Templates
wiki navigation
Main Page
Create Article
Recent changes
Random page
Help
resources
V1R4 Documentation
V1R3 Documentation
Gehry Technologies
search
Go
Search
toolbox
What links here
Related changes
Upload file
Special pages
Printable version
Permanent link
This page was last modified 21:42, 29 October 2007.
Content is available under
terms described in Copyrights.
About gtwiki
Disclaimers
converted by Web2PDFConvert.com
Zgłoś jeśli naruszono regulamin