06-10-2009 09:15 AM
I want to modify some block properties from Xmath, for example to change name of a constant block. I tried something like
Constant1.name="new name";
Can anyone help me?
Thanks,
Jewgenij
Solved! Go to Solution.
06-10-2009 03:31 PM
You can use the SBA (SystemBuild Access, see Chapter 7 of the SystemBuild User guide ) routine modifyblock command to change any SystemBuild
block property. All created blocks have a block id which must be specified as part of the modifyblock command.
For example:
modifyblock 2,{name="myblock",color=2,size=[100,100]}
or to create a gain block
createblock "gain",{gain=2.5,name="accelConstant"}
to retrieve the block id of a created block, pass in a variable set to zero, createblock will set the variable to the created block id
myid = 0
createblock "deadband",{id=myid}
modifyblock myid,{color=1,inputs=2}
You can also get properties of a block using the queryblock command.
[t=threshold,c=color,l=location,t=blocktype] = queryblock(myid)
See Chapter 7 of the SystemBuild Users Guide for more commands and details
06-10-2009 04:16 PM