100% found this document useful (1 vote)
545 views8 pages

Runtime Property

The document describes how to create a custom runtime property in Teamcenter. It has 8 steps - adding a bat file, running BMIDE, creating a project, generating classes, editing project properties, creating a new library and runtime property, creating an extension and generating/building the code. Example C++ code is also provided to get and return the value of the custom property.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
545 views8 pages

Runtime Property

The document describes how to create a custom runtime property in Teamcenter. It has 8 steps - adding a bat file, running BMIDE, creating a project, generating classes, editing project properties, creating a new library and runtime property, creating an extension and generating/building the code. Example C++ code is also provided to get and return the value of the custom property.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 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;
}

You might also like