如何用C脚本给一个对象的颜色属性编程
1个回答
展开全部
在属性的脚本里直接返回值就可以了,return mycolor;
#include "apdefap.h"袭做
long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
// WINCC:TAGNAME_SECTION_START
// syntax: #define TagNameInAction "亩禅态DMTagName"
#define tag_0 "mycolor1"
// next TagID : 1
// WINCC:TAGNAME_SECTION_END
// WINCC:PICNAME_SECTION_START
// syntax: #define PicNameInAction "PictureName"
// next PicID : 1
// WINCC:PICNAME_SECTION_END
long int mycolor,i;
//char* name;
i=GetTagDWord("tag_0"); //Return-Type: DWORD
if(i==1)
mycolor=0x000000FF;
else
mycolor=0x0000FF00;
//name=lpszPropertyName;
//SetTagDWord(name,mycolor); /迅源/Return-Type: BOOL
//return *name;
return mycolor;
}
#include "apdefap.h"袭做
long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
// WINCC:TAGNAME_SECTION_START
// syntax: #define TagNameInAction "亩禅态DMTagName"
#define tag_0 "mycolor1"
// next TagID : 1
// WINCC:TAGNAME_SECTION_END
// WINCC:PICNAME_SECTION_START
// syntax: #define PicNameInAction "PictureName"
// next PicID : 1
// WINCC:PICNAME_SECTION_END
long int mycolor,i;
//char* name;
i=GetTagDWord("tag_0"); //Return-Type: DWORD
if(i==1)
mycolor=0x000000FF;
else
mycolor=0x0000FF00;
//name=lpszPropertyName;
//SetTagDWord(name,mycolor); /迅源/Return-Type: BOOL
//return *name;
return mycolor;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询