Jump to content


  • Content Count

  • Joined

  • Last visited

About andyer

  • Rank

Profile Information

  • Country
    United States
  • Are you University user?
  1. So, it turns out that this command bdeSetBlockStatus () does not work on the current simulation (needs to be fixed). However, a colleague and I (thanks Liv!) were discussing this and he showed me that I can achieve the same behavior by using an Include block on Activate. What you do is to put the superblocks you want to use in your model with Status = off. Then use an include block to select which one you want to use and the Include block will automagically turn the Status = on to the one selected. You can use the commands below to get the name of the model so you can self-reference to the path required in the Include block, e.g.: model_path=bdeGetModelFilePath(bdeGetCurrentModel()); [current_dir,model_name,model_ext]=fileparts(model_path); model_nameTotal=[model_name,model_ext]; %<--- put this as the name of the "Model path" in the Include block so you can self reference in case you change the name of your model Happy simulating, and thanks again, Liv! Cheers, Andy
  2. Hello Activate friends, I'm running through some tests/reviewing the docs to understand what is possible when running Activate in batch with an OML file as the input. (Activate_batch.bat -f file.oml) Thanks, Hai, for the help with my first questions! Attached is an example attached here which is working - I can run on command line and Activate creates a .csv file and I can set/get variables. This is good. For anyone interested to run this, there are comments within the attached .oml and some notes on how to get additional information (see run_interactive_oml_in_batch.oml). This model was created/tested using Activate v2019. I would like to clarify a few features to understand what is supported or not to see if anyone has suggestions/additional information. Questions: 1. It appears that the OML "bde..." commands like are in some of the optimization examples in Chapter 6 of the "Extended Definitions..." documentation are not supported when calling Activate in batch (e.g., Activate_batch.bat -f name.oml, correct? Not sure I need these yet, but was reviewing some of the other examples and initially I tried to use the "bde..." commands unsuccessfully. Are there any other limitations for commands to be aware of? 2. If I would like to set Activate model variables, I can use the Model context to overwrite/reset variables this is done in the example attached here and described in the docs (Extended...Section: 6.4.1). Alternatively, if I would like to set variable instead in Diagram Context, can this be done in batch? Does anyone have an example of this? 3. The "Signal Out" block is used to get variables back from the Activate model to the OML script. Are there any other methods to get variables back, e.g., is it possible to also use the "To Base" block? Thanks, Andy run_interactive_oml_in_batch.oml example_run_Activate_in_batch.scm
  3. Here's a couple of commands to help you get the Full name of blocks: First, select the block you want by clicking on it. Then in the command window, use: blk=bdeGetSelectedBlock(bdeGetCurrentDiagram) bdeGetBlockFullName(blk) Voila!
  4. Looks like I figured it out with some trial and error. If the name of my block is 'SuperBlock', then you can do this with the following commands which deactivate (status = off) or activate, respectively: > bdeSetBlockStatus(bdeGetBlockByFullName('SuperBlock'), 'off') > bdeSetBlockStatus(bdeGetBlockByFullName('SuperBlock'), 'on')
  5. O learned denizens of the Activate forum, Is there a way to set the status of a block (Superblock in this case) programmatically? (e.g. to do this via GUI, right click on a block to select Status --> On/Off). I would like to control the topology of my model via some scripting if possible and wondering if I can do this by controlling the status (or if you have another suggestion I'm open to it, too). Cheers, Andy
  6. Hi everyone, I have a tip I think might be helpful to others as it is helpful to me to load external data files in my Activate models without having to worry about the file path to the data if the model is moved/shared with someone else. If you have data in external files (e.g. like a .mat file or whatever), you may load this into Activate with commands in the Model or Diagram Contexts. Here you need to either have a relative or absolute path to the file: load('my_model_data.mat') <-- must be in the directory set in "File Browser" or load('C:\my_absolute_path\my_model_data.mat') However, if you want to make your model more generic and portable to other directories, you can use the command "bdeGetCurrentModelFilePath", which returns the same path as your Activate model. Then, you can define the model data relative to your model path (e.g., like in the same directory, as below): my_path=bdeGetCurrentModelFilePath() file_path=strcat(my_path,'/../my_model_data.mat') load(file_path); This is nice when sharing models with others so the paths can be set automagically. Hope this helps someone... Cheers, Andy
  7. andyer

    Naming the figure

    Hi Berker, I played around with this a bit : I've found that this works when I test our development build of the next release of Compose (2018.1). However, it is not yet available in 2017.3 so it doesn't help you currently. I'm not aware of a target date for the next release, but this is something to look for. Not sure if this helps, but note that you can rename the figure in 2017.3 by clicking on the name modifying it in the Project Browser. I'm not aware of another command to do this programmatically yet. Perhaps someone else can chime in... Best regards, Andy