VS2019 NX1946
//用户代码
#include <uf_layer.h>
#include <NXOpen/ListingWindow.hxx>
UF_initialize();
theSession->ListingWindow()->Open();
std::vector<int> ObjTagVector;//对象TAG容器
ObjTagVector.clear();
char msg[256];
int i = -1;
tag_t objTAG = NULL_TAG;
do
{
UF_LAYER_cycle_by_layer(0, &objTAG);//0是所有图层,指定图层1~256
i++;
if (objTAG !=0)
{
ObjTagVector.push_back(objTAG);
}
}
while (objTAG != NULL_TAG);
for (int i = 0; i < ObjTagVector.size(); i++)
{
sprintf (msg, "%d", ObjTagVector[i]);
theSession->ListingWindow()->WriteLine(msg);
}
UF_terminate();
怡宁塑胶模具设计