Part Appearance Control
Part Appearance Control
(OP)
Has anyone ever heard of controlling the color/transparency of a part/solid with an expression?
For example: Parameterizing a part's color and/or transparency to respond to a measure during a simulation.
Is this possible? Can appearance attributes be accessed and manipulated during a simulation?
Thanks,





RE: Part Appearance Control
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Part Appearance Control
How might I begin if my goal were to activate/deactivate parts based on sensor/measurement output?
Thanks,
RE: Part Appearance Control
However so far as I can see DEACTIVATE does not work on colors or parts.
This would be a very good question for the msc adams forum.
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Part Appearance Control
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Part Appearance Control
And it really doesn't matter anyway, what would you use it for?
What I think you are after is a way to affect the animation based on simulation results. And that is doable using the MDI_ANIMATION_CALLBACk macro.
Must have this name and call, and will be called by PPT before each frame.
Here is a simple example:
!USER_ENTERED_COMMAND mdi_animation_callback
!
!
if cond=(eval(mdi_animation_counter) == 45)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 0
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 100
!
elseif cond=(eval(mdi_animation_counter) == 46)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 10
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 90
!
elseif cond=(eval(mdi_animation_counter) == 47)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 20
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 80
!
elseif cond=(eval(mdi_animation_counter) == 48)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 30
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 70
!
elseif cond=(eval(mdi_animation_counter) == 49)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 40
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 60
!
elseif cond=(eval(mdi_animation_counter) == 50)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 50
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 50
!
elseif cond=(eval(mdi_animation_counter) == 51)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 60
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 40
!
elseif cond=(eval(mdi_animation_counter) == 52)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 70
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 30
!
elseif cond=(eval(mdi_animation_counter) == 53)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 80
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 20
!
elseif cond=(eval(mdi_animation_counter) == 54)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 90
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 10
!
elseif cond=(eval(mdi_animation_counter) == 55)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 100
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 0
!
elseif cond=(eval(mdi_animation_counter) == 65)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 100
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 0
!
elseif cond=(eval(mdi_animation_counter) == 66)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 90
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 10
!
elseif cond=(eval(mdi_animation_counter) == 67)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 80
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 20
!
elseif cond=(eval(mdi_animation_counter) == 68)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 70
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 30
!
elseif cond=(eval(mdi_animation_counter) == 69)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 60
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 40
!
elseif cond=(eval(mdi_animation_counter) == 70)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 50
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 50
!
elseif cond=(eval(mdi_animation_counter) == 71)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 40
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 60
!
elseif cond=(eval(mdi_animation_counter) == 72)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 30
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 70
!
elseif cond=(eval(mdi_animation_counter) == 73)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 20
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 80
!
elseif cond=(eval(mdi_animation_counter) == 74)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 10
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 90
!
elseif cond=(eval(mdi_animation_counter) == 75)
entity attributes entity_name = .model_1.PART_2.CYLINDER_1 transparency = 0
entity attributes entity_name = .model_1.PART_2.BOX_2 transparency = 100
!
end
!
!-----------------------------------------
! Increment counter
!-----------------------------------------
!
variable modify variable=mdi_animation_counter integer = (eval(mdi_animation_counter) + 1)
if cond=(eval(mdi_animation_counter) > 100)
variable set variable=mdi_animation_counter integer = 1
end !if
!
Jesper Slattengren
www.prattmiller.com