tag:blogger.com,1999:blog-10425945.post110727859310465473..comments2024-03-14T18:15:27.812-03:00Comments on ObjectARX & Dummies: Class 1 - OverviewFernando Malardhttp://www.blogger.com/profile/09852061806995998594noreply@blogger.comBlogger28125tag:blogger.com,1999:blog-10425945.post-43148572519881730832024-03-14T18:02:32.725-03:002024-03-14T18:02:32.725-03:00hola en la actualidad pude instalar el ObjectARXWi...hola en la actualidad pude instalar el ObjectARXWizard2024.msi para ObjectARX2024 con Visual Studio 2022, gracias por su contenido.Tecprog Worldhttps://www.blogger.com/profile/11528960423092116580noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-20516794269768033332015-08-27T08:29:11.522-03:002015-08-27T08:29:11.522-03:00Hello Rahul,
The method AcDbRegion::createFromCur...Hello Rahul,<br /><br />The method AcDbRegion::createFromCurves() accepts any closed curve derived from AcDbCurve class.<br />AcDbCircle, which represents a circle entity in AutoCAD, is also derived from AcDbCurve:<br /><br />======================================<br />AcDbRegion::createFromCurves()<br /><br />This static member function creates a set of AcDbRegion objects from the closed loops represented by the curves contained in the curveSegments array. The newly created region objects are returned in the regions array. <br /><br />The curveSegments array must contain only pointers to AcDbLine, AcDbArc, AcDbEllipse, AcDbCircle, AcDbSpline, AcDb3dPolyline, or AcDbPolyline objects. <br /><br />Note<br />The objects in curveSegments must be opened for read and not for write. If the objects are opened, calling this function will crash AutoCAD. <br /><br />It is the calling application's responsibility to either add the AcDbRegion objects returned in the regions array to an AcDbDatabase or to delete them when they are no longer needed. <br /><br />Returns Acad::eOk if the function is completely successful. If there is any problem during the creation of an AcDbRegion from any of the curves in curveSegments, then this function returns Acad::eInvalidInput and the regions array contains pointers to any AcDbRegion objects that were created before the error occurred. So, do not assume that a non-Acad::eOk return status indicates a total failure with no dynamically-allocated AcDbRegion objects returned.<br /><br />======================================<br /><br />Regards,Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-55849921550954072142015-08-27T04:42:18.757-03:002015-08-27T04:42:18.757-03:00Hi Fernando,
I have set the region of my rectangl...Hi Fernando,<br /><br />I have set the region of my rectangle in the following way.<br /><br />AcGePoint3dArray pointArray;<br /> ads_real length,width;<br /><br /> AcGePoint3d VertexPoint((0.0), (0.0), (0.0));<br /> pointArray.append(VertexPoint);<br /> <br /> if (acedGetReal(L"\nenter length of rectangle ",&length)!=RTNORM) {<br /> return;<br /> }<br /><br /> VertexPoint.set(((length1)), (0.0), (0.0));<br /> pointArray.append(VertexPoint);<br /><br /> if (acedGetReal(L"\nenter width of rectangle ",&width)!=RTNORM) {<br /> return;<br /> }<br /> <br /> VertexPoint.set(((length)), (width), (0.0));<br /> pointArray.append(VertexPoint);<br /><br /> VertexPoint1.set((0.0), (width), (0.0));<br /> pointArray.append(VertexPoint);<br /> <br /> VertexPoint.set((0.0), (0.0), (0.0));<br /> pointArray.append(VertexPoint);<br /><br />How can I set the region for a circle? Can I set it in a similar way?<br /><br />RegardsRahulnoreply@blogger.comtag:blogger.com,1999:blog-10425945.post-85411883571445184502015-08-21T08:11:49.780-03:002015-08-21T08:11:49.780-03:00you are just awesome... thanks alot!!
I hope I wil...you are just awesome... thanks alot!!<br />I hope I will learn ObjectARX in quick succession with your guidance.<br /><br />Regards,<br />rahulRahulnoreply@blogger.comtag:blogger.com,1999:blog-10425945.post-37328280257966913102015-08-20T09:12:05.996-03:002015-08-20T09:12:05.996-03:00Hi Rahul,
A rectangle is not an entity itself, it...Hi Rahul,<br /><br />A rectangle is not an entity itself, it is indeed a Polyline.<br />As any Polyline it is created by passing in its vertexes so you need to calculate them yourself.<br />Make sure you also set Polyline as closed so it behaves appropriately.<br /><br />Regards,Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-73293495897173168272015-08-20T09:08:23.912-03:002015-08-20T09:08:23.912-03:00Fernando,
I have drawn a rectangle and then I ext...Fernando,<br /><br />I have drawn a rectangle and then I extruded it. But I dont know how can I specify the length and width of my rectangle dynamically?<br /><br />Is there any API to specify length and width?Rahulnoreply@blogger.comtag:blogger.com,1999:blog-10425945.post-47279524174472132072015-08-19T08:16:22.231-03:002015-08-19T08:16:22.231-03:00Rahul,
The AcDbRegion is a planar entity so it ha...Rahul,<br /><br />The AcDbRegion is a planar entity so it has a normal vector which is used to drive the extrusion direction.<br />If your region represents the XY base of your solid it is going to be extruded towards it height direction Z.<br /><br />So the extrusion depends on the region normal.<br /><br />If you need an irregular extrusion, i.e., following a curve path, take a look at this other method:<br /><br /><b><br />virtual Acad::ErrorStatus extrudeAlongPath(<br /> const AcDbRegion* region, <br /> const AcDbCurve* path, <br /> double taperAngle = 0.0<br />);<br /></b><br /><br />Regards,Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-31662516846617654332015-08-19T08:11:20.632-03:002015-08-19T08:11:20.632-03:00Hi Fernando,
thanks for your prompt reply. I hav...Hi Fernando, <br /><br />thanks for your prompt reply. I have generated solid by using the method<br /><br />virtual Acad::ErrorStatus extrude(<br /> const AcDbRegion* region, <br /> double height, <br /> double taperAngle = 0.0<br />);<br /><br />but instead of taperAngle I need to extrude my rectangle through its length, breadth and height. Can you help me outRahulnoreply@blogger.comtag:blogger.com,1999:blog-10425945.post-78976454947928378032015-08-06T07:46:56.318-03:002015-08-06T07:46:56.318-03:00Hi,
You have several options.
I believe you actua...Hi,<br /><br />You have several options.<br />I believe you actually meant you want to extrude a region to generate a solid.<br /><br />If so, take a look at the following method:<br /><br />virtual Acad::ErrorStatus extrudeAlongPath(<br /> const AcDbRegion* region, <br /> const AcDbCurve* path, <br /> double taperAngle = 0.0<br />);<br /><br /><b>"Creates a solid by extruding region along the path curve. path must be an AcDbLine, AcDbArc, AcDbCircle, AcDbEllipse, AcDbSpline, AcDb2dPolyline, or a non-spline fit AcDb3dPolyline. path should not have self-intersections and, preferably, should not have high curvature areas. If one of the endpoints of the path is not on the plane of the region, then the path will be moved to make this true."</b><br /><br />Regards.Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-13300852946595062362015-08-06T04:06:04.569-03:002015-08-06T04:06:04.569-03:00Hi fernando,
I need to draw a solid by extruding ...Hi fernando,<br /><br />I need to draw a solid by extruding an existing solid. Can you give some reference code as to how to make it.<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-10425945.post-32463617160499283922014-02-07T10:28:02.921-02:002014-02-07T10:28:02.921-02:00Hello,
I'm afraid it can't be easily done....Hello,<br />I'm afraid it can't be easily done.<br />The Export() method defaults the window are to be exported so I don't think there is a way to change this behaviour.<br /><br />I think you will need to do something after the bitmap is generated by calculating the entity Bounding Box (in screen coordinates) and cropping the bitmap with that information.<br /><br />Sorry about the bad news.<br />Regards,Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-74619211814151677932014-02-06T07:43:34.615-02:002014-02-06T07:43:34.615-02:00Hello Fernando,
Can you please tell me ho...Hello Fernando,<br /> Can you please tell me how to form bitmap of definite size say 32 X 32 pixel from Selection Set in ObjectARX 2010. I can do it from Export() function on IAcadDocument, but it gives me bitmap of complete view. I want the bitmap of only selected entity cropped in.<br /><br />Thanks in Advance.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-10425945.post-26385403835320655412013-04-17T14:00:49.311-03:002013-04-17T14:00:49.311-03:00Guy, just answered you at the previous post.
Thank...Guy, just answered you at the previous post.<br />Thank you,Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-75983476798392741832013-04-17T13:59:41.201-03:002013-04-17T13:59:41.201-03:00Hello,
Unfortunately only Visual Studio is suppor...Hello,<br /><br />Unfortunately only Visual Studio is supported for ObjectARX development.<br /><br />You can use (with some limitations) the Express version which is FREE.<br /><br />Please take a look at this post from my friend Kean: http://through-the-interface.typepad.com/through_the_interface/2006/07/getting_the_obj.html<br /><br />Hope this help you.<br />Regards,Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-80664720182332598302013-04-17T13:36:50.066-03:002013-04-17T13:36:50.066-03:00Dear, thank you for this blog
I'm a Civil Engi...Dear, thank you for this blog<br />I'm a Civil Engineer working in France.<br />Can I used another compiler program than Microsoft Visual Studio to program with Object ARX?<br /><br />My best IDE for C++ is Code Block. Can I use it to program Autocad with ObjectARX ? Please could wou explain me how to setup the ARX for CodeBlocks ??<br />Thank you for your helpsAnonymoushttps://www.blogger.com/profile/00547209565440779070noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-87240495095306304112013-04-17T13:35:00.281-03:002013-04-17T13:35:00.281-03:00Dear, thank you for this blog
I'm a Civil Engi...Dear, thank you for this blog<br />I'm a Civil Engineer working in France.<br />Can I used another compiler program than Microsoft Visual Studio to program with Object ARX?<br /><br />My best IDE for C++ is Code Block. Can I use it to program Autocad with ObjectARX ? Please could wou explain me how to setup the ARX for CodeBlocks ??<br />Thank you for your helpsAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-10425945.post-84011263134740601292011-01-29T10:17:02.574-02:002011-01-29T10:17:02.574-02:00smita,
I have answered your question at the other...smita,<br /><br />I have answered your question at the other thread. Please do not post the same issue at different threads. The publish process needs my approval due the SPAM protecting measures so depending on my availability it may take some time to appear after you submit it.<br /><br />Regards.Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-83435117116695377212011-01-28T07:04:22.661-02:002011-01-28T07:04:22.661-02:00Hi,
I have tried u'r following code from class...Hi,<br />I have tried u'r following code from class 5,<br /><br /><br />ads_name na;<br />AcDbObjectId id;<br />acedSSGet(_T("L"),NULL,NULL,NULL,na);<br />acdbGetObjectId(id,na);<br />AcDbEntity* pEnt = NULL;<br />if (acdbOpenObject(pEnt, id, AcDb::kForRead) == Acad::eOk) {<br />if (pEnt->colorIndex() != 3) {<br />pEnt->upgradeOpen();<br />pEnt->setColorIndex(3);<br />}<br />else {<br />acutPrintf(_T("\nEntity already has color=3"));<br />}<br />pEnt->close();<br />}<br /><br /><br /><br /><br /><br /><br /><br /><br />but,i got error at acdbOpenObject.<br />error is:-<br />fatal error:Unhandled access violation reading 0x0005 Exception at 620663e4h.<br />Can u help me.<br />Thanking you.<br />Smita.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-10425945.post-22494780168546766122011-01-21T09:37:37.530-02:002011-01-21T09:37:37.530-02:00kirti,
Unfortunately I don't have a sample wh...kirti,<br /><br />Unfortunately I don't have a sample which demonstrate this.<br /><br />The best reference is the sample "\ObjectARX 2010\samples\database\testdb_dg".<br /><br />The term "dimension" is different depending on the type of entity you are dealing with. For a LINE entity it will be the distance between its start and end points. For a CIRCLE or ARC it will be the curve length, etc.<br /><br />I would recommend you to take a look at the AcDbCurve derived classes like these:<br /><br /> AcDb2dPolyline<br /> AcDb3dPolyline<br /> AcDbArc<br /> AcDbCircle<br /> AcDbEllipse<br /> AcDbLeader<br /> AcDbLine<br /> AcDbPolyline<br /> AcDbRay<br /> AcDbSpline<br /> AcDbXline<br /><br />All classes are base on parametric curves and you will have methods such as getDistAtPoint() and getDistAtParam().<br /><br />Hope this help.<br />Regards,Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-72724743161743955762011-01-21T02:00:13.888-02:002011-01-21T02:00:13.888-02:00Hi,
Please can you send me a sample code for readi...Hi,<br />Please can you send me a sample code for reading existing dwg file and for reading the dimension of an entity<br />Thnking you in advance.kirtihttps://www.blogger.com/profile/07767990660488707177noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-52318296112162125272010-08-17T17:04:08.728-03:002010-08-17T17:04:08.728-03:00Hello,
All the transformations like MOVE, ROTATE,...Hello,<br /><br />All the transformations like MOVE, ROTATE, etc. are made through the transformBy() method.<br /><br />Once you override it you can tweak the behavior of your custom entity when receiving these commands.<br /><br />Take a look at the transformBy() method documentation for a better understanding of its capabilities.<br /><br />Cheers.Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-66507966767233942372010-08-17T16:31:34.430-03:002010-08-17T16:31:34.430-03:00How can I make a custom object derived from AcDbLi...How can I make a custom object derived from AcDbLine or AcDBPolyline, having constraints in XY, YZ or XZ planes when moving or dragging itAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-10425945.post-56909266477647123592007-10-26T13:42:00.000-02:002007-10-26T13:42:00.000-02:00Hello Wassim,Yes, it is possible to program AutoCA...Hello Wassim,<BR/><BR/>Yes, it is possible to program AutoCAD with C# and VB.NET.<BR/><BR/>If you need, you can mix the C++ world with .NET using mixed-mode modules.<BR/><BR/>I would recommend you a very nice Blog of a friend:<BR/><BR/>http://through-the-interface.typepad.com/<BR/><BR/>Regards,Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.comtag:blogger.com,1999:blog-10425945.post-11121833754488003982007-10-26T13:15:00.000-02:002007-10-26T13:15:00.000-02:00Hi,Very interesting!I'm a CSharp (C#) developer an...Hi,<BR/><BR/>Very interesting!<BR/><BR/>I'm a CSharp (C#) developer and I wish to use my CSharp skills to develop Autocad based applications, is it possible to develop ObjectARX applications using CSharp as a programming language? If not; what is the right choice between VB.Net, VBA and C++?<BR/><BR/>Thanks Fernando.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-10425945.post-6613879728240122612007-07-06T08:18:00.000-03:002007-07-06T08:18:00.000-03:00Hi,ObjectARX 2004: Will run on AutoCAD 2004, 2005 ...Hi,<BR/><BR/>ObjectARX 2004: Will run on AutoCAD 2004, 2005 and 2006. Requires Visual Studio 2002<BR/><BR/>ObjectARX 2007: Will run on AutoCAD 2007 and 2008. Requires Visual Studio 2005<BR/><BR/>Regards,<BR/>Fernando.Fernando Malardhttps://www.blogger.com/profile/09852061806995998594noreply@blogger.com