Cancel
Showing results for 
Search instead for 
Did you mean: 

Why part color cannot be edited after running the script

Experimenter
Experimenter

 After I changed the part color by using the script, the part color cannot be changed any more interactively neither in VisMockup or with the code. Seems the color is locked after assigning the material. Any help to solve this? below is the code I used to assign the color.

 

param (
[double]$R,
[double]$G,
[double]$B
)

$VisObj = New-Object -ComObject VFFrame.Application
$VisApp = [System.__ComObject].InvokeMember("VisAppAutomation", [System.Reflection.BindingFlags]::GetProperty, $null, $VisObj, $null)

$material = $VisApp.ActiveView.RootNode.BasicMaterial
$material.Ambient.Red = $R
$material.Ambient.Green = $G
$material.Ambient.Blue = $B
$material.Diffuse.Red = $R
$material.Diffuse.Green = $G
$material.Diffuse.Blue = $B
$VisApp.ActiveView.RootNode.BasicMaterial = $material

 

Thank you.

 

David

1 REPLY

Re: Why part color cannot be edited after running the script

Siemens Genius Siemens Genius
Siemens Genius

Not sure what is going on here but I am not aware of any JT file setting that locks color in a JT file. Suspect this is an application level setting

Mike Z