MATRIXx

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change block properties from Xmath?

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(12,266 Views)
Solution
Accepted by JewgenijTarschis

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

 

 

 

     

 

0 Kudos
Message 2 of 3
(12,258 Views)
Thank you very much for this answer!
0 Kudos
Message 3 of 3
(12,253 Views)