I am working on the legacy code, I came across the following code
acedCommandS(RTPOINT, pt, 0);
any idea about what it does? I looked for the definition of RTPOINT and it is as below in the file adscodes.h
#define RTPOINT 5002 /* 2D point X and Y only */
My legacy code is not working properly because this piece of code is not working properly and I am not able to find anything about the same. Thanks in advance.
Harshad
You have to call acedCommandS with full command. Such as: acedCommandS(RTSTR, L"_POINT", RT3DPOINT, pt, 0);
But you can not call acedCommandS with not full command data.
In any case, I recommend not using acedCommandS/acedCommandC and replace it with own code.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Thank you Alex for reply, I found this in my legacy code which was working in the prior versions, it was acedCommand instead of acedCommandS.
if we go with acedCommandS(RTSTR, L"_POINT", RT3DPOINT, pt, 0); it will create a point entity. but this code was not meant for creating point. Any idea or observation where it is used in the form I mentioned? Thanks a lot in advance.
@Anonymous wrote:
...Any idea or observation where it is used in the form I mentioned? Thanks a lot in advance...
It can was used in loop of providing vertexes of Polyline such as:
acedCommand(RTSTR,L"_PLINE", 0); for (int i = 0 ; i < n; i++) { acedCommand(RTPOINT,pts[i],0); } acedCommand(RTSTR,L"",0);
But with acedCommandS you can not do the same as far as acedCommandS have to be have full command list from start to end. For example,
acedCommand(RTSTR, L"_PLINE", RTPOINT, pts[0], RTPOINT, pts[1], RTPOINT, pts[2], RTSTR, L"", 0);
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Thank you so much Alex, this is something I was not really aware, acedCommand(RTPOINT...). Now we can't replace this with acedCommandS() as it accepts only full parameters. So as you said it was getting used for setting the vertex of a polyline. How we can replace in ObjectARX 2017? Any clues? Thanks in advance.
Harshad
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Hello Alex,
I am able to move ahead with the input you gave, thanks a ton for the same! Command could be ended in the earlier versions of ARX by using acedcommand(0). So if I call acedCommandS() for line or polyline command, is there any way I can do it like acedCommand(0)? Will appreciate your input.
Thanks in advance.
Harshad
You try to do impossible things. Please look at this sample (it is using acedCmdS instead of acedCommandS):
//----------------------------------------------------------------------------- //----- acrxEntryPoint.cpp //----------------------------------------------------------------------------- #include "StdAfx.h" #include "resource.h" #include <acedCmdNF.h> //----------------------------------------------------------------------------- #define szRDS _RXST("") //----------------------------------------------------------------------------- //----- ObjectARX EntryPoint class CArxProject8App : public AcRxArxApp { public: CArxProject8App () : AcRxArxApp () {} virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) { AcRx::AppRetCode retCode = AcRxArxApp::On_kInitAppMsg (pkt) ; return (retCode) ; } virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) { AcRx::AppRetCode retCode = AcRxArxApp::On_kUnloadAppMsg (pkt) ; return (retCode) ; } virtual void RegisterServerComponents () { } static void RivilisMyLine () { AcGePoint3dArray pts; ads_point pt; // Ask points while (acedGetPoint((pts.length() == 0) ? NULL : asDblArray(pts.last()), L"\nNext point: ", pt) == RTNORM) { pts.append(asPnt3d(pt)); } // List for acedCmdS resbuf *cmdbuf = acutBuildList(RTSTR, L"_LINE", RTNONE); for (int i = 0; i < pts.length(); i++) { AddToResbufList(cmdbuf, acutBuildList( RTSTR, L"_none", // remove OSNAP RT3DPOINT, asDblArray(pts[i]), // Next point RTNONE) ); } cmdbuf = AddToResbufList(cmdbuf, acutBuildList(RTSTR, L"", RTNONE)); // Command end acedCmdS(cmdbuf); acutRelRb(cmdbuf); } // Function add tail to list static resbuf *AddToResbufList( resbuf *head, // Head of list resbuf *tail // New tail of list ) { if (head == NULL) return tail; resbuf *rb = head; while (rb->rbnext) rb = rb->rbnext; rb->rbnext = tail; return head; } } ; //----------------------------------------------------------------------------- IMPLEMENT_ARX_ENTRYPOINT(CArxProject8App) ACED_ARXCOMMAND_ENTRY_AUTO(CArxProject8App, Rivilis, MyLine, MyLine, ACRX_CMD_MODAL, NULL)
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn