Welcome To Support Community

Materials Studio

Advanced Search
Ask Search:
KocicSKocicS 

create default Display style

Tough I know it is possible to change default Display style for overall structure, I was wondering if it is possible to create default Display style for overall structure whose parts are differently represented? That is to say, if I had slab structure of 4 layers, I wouldn't be interested in  seeing  two bottom layers (since they dont  move in my simulations). In other words, I would like to set geometrical constraint for default display style of type: bottom two layers (defined by z axis) will be presented as line , on the other side, the top two layers are of interest and I would like to see them as Ball and Stick
CarstenCarsten (Accelrys) 
The only idea I have is to consequently define sets of the layers from the beginning and then have a script added to the "user menu" which changes the display style accordingly.
victor.milmanvictor.milman
Alternatively you could change "Range" setting for the Lattice display style, so that the bottom layers were simply cut off (if you don't want to see them).
Victor
StephenStephen (Accelrys) 
This is a variation on Carsten's answer. If you have fixed the bottom layers using Constraints in Materials Studio, you could use a script to query whether the atoms are fixed and set their display style accordingly.

$atom->IsFixed("XYZ")

Cheers

Stephen
KocicSKocicS
Hello,

I come back to this question with additional sub-question. I have read all the answers provided here but,

1) Where can I find a syntax for scripting concerning manipulation of display style? That is to say, I have never used scripting tool and therefore I don't know how to write a code that will change, for example, that my .xsd file has stick representation ? I am therefore exclusively interested in Display Style (and options therein) manipulation of .xsd file using a script. 

2) When I write a script for inducing those changes to my .xsd file, can I apply the same script to the ensemble of .xsd files simultaneously

Best wishes,
Stefan 
Jason DeJoannisJason DeJoannis
Hi KocicS,
 
To find the documentation, look in the Help under the category:
Scripting in Materials Studio > MaterialsScript API > Classes > 3D Model Document > A-C > Atom
 
Every atom has a Style property which can be set to “Ball and Stick”, “Line”, “CPK” etc. To see what else the Style property can be applied to, check out:
Scripting in Materials Studio > MaterialsScript API > Properties > 3D Model Document > R-S > Style
 
Example:
my $atoms = $doc->UnitCell->Atoms;
foreach my $atom (@$atoms)
{
     if ($atom->Z < 10)
     {
          $atom->Style = “Line”;
     }
     else
     {
          $atom->Style = “Ball and Stick”;
     }
}
 
Best,
Jason