Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Part Appearance Control

Status
Not open for further replies.

zcwrunner

Mechanical
Jan 31, 2007
3
0
0
US

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,
 
Replies continue below

Recommended for you

What if I were to make an identically shaped solid/part with a different color that is activated by a sensor?
How might I begin if my goal were to activate/deactivate parts based on sensor/measurement output?
Thanks,
 
Can you explicitly deactivate parts inside a solver run, or do you have to STOP the simulation, and then DEACTIVATE parts in the acf, and then RELOAD the simulation?

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.
 
A bit more research suggest that the solver is colorblind. View writes out a separate text file, .cmd I think, with colors in, but the solver never sees them.

Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Greg is right, as usual. The solver does not know much or can affect the color, transparency or other graphical phenomenas.
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
 
Status
Not open for further replies.
Back
Top