Sie sind auf Seite 1von 8

RUNTIME PROPERTY

Step:1

Add the line call "D:\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64

to bmide.bat file

Step:2

Run BMIDE through bmide.bat

Step:3

Create a New Bmide project

Step:4

Generate C/C++ classes by clicking Generate C/C++ classes in Generate Code


Step:5

Edit the Project


Properties as
follows:
Step:6

Create a Create a new library and new custom runtime property


Step:7

Create
new

extension.
Give Extension Availability for runtime property like this
Step:8
Generate

extension code and build project

Refer the following example code:

//@<COPYRIGHT>@
//==================================================
//Copyright $2018.
//Siemens Product Lifecycle Management Software Inc.
//All Rights Reserved.
//==================================================
//@<COPYRIGHT>@

//
// @file
// This file contains the implementation for the Business Object
K2customobject1RevisionImpl
//

#include <K2myreflibrary/K2customobject1RevisionImpl.hxx>

#include <fclasses/tc_string.h>
#include <tc/tc.h>
#include<iostream>
using namespace std;
#include<tccore\grm.h>
#include<property/prop.h>
#include<tccore/aom.h>
#include<tccore/aom_prop.h>

using namespace k2newproject;

//----------------------------------------------------------------------------------
//
K2customobject1RevisionImpl::K2customobject1RevisionImpl(K2customobject1Revisio
n& busObj)
// Constructor for the class
//----------------------------------------------------------------------------------
K2customobject1RevisionImpl::K2customobject1RevisionImpl( K2customobject1Revisi
on& busObj )
: K2customobject1RevisionGenImpl( busObj )
{
}

//----------------------------------------------------------------------------------
// K2customobject1RevisionImpl::~K2customobject1RevisionImpl()
// Destructor for the class
//----------------------------------------------------------------------------------
K2customobject1RevisionImpl::~K2customobject1RevisionImpl()
{
}
//----------------------------------------------------------------------------------
// K2customobject1RevisionImpl::initializeClass
// This method is used to initialize this Class
//----------------------------------------------------------------------------------
int K2customobject1RevisionImpl::initializeClass()
{
int ifail = ITK_ok;
static bool initialized = false;

if( !initialized )
{
ifail = K2customobject1RevisionGenImpl::initializeClass( );
if ( ifail == ITK_ok )
{
initialized = true;
}
}
return ifail;
}
///
/// Getter for an String Array Property
/// @param values - Parameter value
/// @param isNull - Returns true for an array element if the parameter value at that
location is null
/// @return - Status. 0 if successful
///
int K2customobject1RevisionImpl::getK2myrefBase( std::vector<std::string> & values
, std::vector<int> & isNull ) const
{
int ifail = ITK_ok;

// Your Implementation
char * prop=NULL,*prop1=NULL,*prop2=NULL;
int count1 =0;
tag_t *tsecobj = NULLTAG,trelation = NULLTAG,objecttag = NULLTAG;
std::vector<string> objectname;
objecttag=this->getK2customobject1Revision()->getTag();
AOM_ask_value_string(objecttag,"object_name",&prop)
cout<<"prop"<<prop;
GRM_create_relation_type("IMAN_reference",&trelation);
GRM_list_secondary_objects_only(objecttag, trelation, &count1, &tsecobj);
if(tsecobj!=NULLTAG)
{
cout<<"secobj is present";
int status= AOM_ask_value_string(tsecobj[0],"object_name",&prop2);
cout<<prop1;
for(int i=0;i<count1;i++)
{
int status= AOM_ask_value_string(tsecobj[i],"object_name",&prop1);
cout<<"status"<<status;
objectname.push_back(prop1);
cout<<objectname.at(i);
cout<<objectname.size();
}
}
if(!objectname.empty())
{
std::copy(objectname.begin(),objectname.end(),std::back_inserter(values));
for(int i=0;i<objectname.size();i++)
{
isNull.push_back(0);
}
}
return ifail;
}

Das könnte Ihnen auch gefallen