ch3_3commands.cpp

来自「ARX二次开发」· C++ 代码 · 共 50 行

CPP
50
字号
/////////////////////////////////////////////
// ObjectARX defined commands

#include "StdAfx.h"
#include "StdArx.h"


// This is command 'TSS'
void tss()
{
	int i	;			// Row of ads_matrix
	ads_matrix xform;	// The transformation matrix
	ads_name ssGrp;		// The entities that make up transform SS
	int rc;				// Return code
	ads_real sf;		// Scale Factor


	// Select the entities
	acedPrompt("\nSelect enties to scale (transfrom) ");
	rc = acedSSGet(NULL, NULL, NULL, NULL, ssGrp);
	if(rc != RTNORM)
	{
		acutPrintf("\nEmpty or invalid selection set ");
		return;
	}

	// Input the scale factor
	acedInitGet(RSG_NONULL + RSG_NONEG + RSG_NOZERO, NULL);
	acedGetReal("\nTransformation Scale factor: ", &sf);

	// Initialize the matrix
	ident_init(xform);

	// Apply the scaling factor
	// to the matrix
	for(i = 0; i <= 3; i++)
	{
		xform[i][i] = sf;
	}
	
	rc = acedXformSS(ssGrp, xform);
	if(rc != RTNORM)
	{
		acutPrintf("\nFailed in transformation of selection set. ");
	}

	acedSSFree(ssGrp);	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?