<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: worldDraw call getting crashed in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9303129#M4826</link>
    <description>&lt;P&gt;&lt;FONT&gt;Thanks, Madhukar for being so active on the thread and yes you have paved the way to the solution. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;The answer was hiding behind rxInit() only .&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Following are the changes done by me :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Custom class derived over AcGiContext was initialized in the following manner earlier :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;ACRX_DEFINE_MEMBERS(CustomTranAcGiContext);&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;which I changed now to ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;ACRX_NO_CONS_DEFINE_MEMBERS(&lt;FONT&gt;CustomTranAcGiContext&lt;/FONT&gt;, AcGiContext);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;And&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;CustomTranAcGiContext&lt;/FONT&gt;&lt;/FONT&gt;::rxInit(); was called inside the InitApp and then&amp;nbsp;acrxBuildClassHierarchy(); was called and we are done .&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Thanks again &lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2020 12:14:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-07T12:14:34Z</dc:date>
    <item>
      <title>worldDraw call getting crashed</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291758#M4816</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am experiencing a problem with AcDb3dSolid object with the latest ObjectArx for Autocad Rogue Release Candidate .&amp;nbsp;&lt;/P&gt;&lt;P&gt;While calling worldDraw with the object it is getting crashed .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance !&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 05:27:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291758#M4816</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-03T05:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: worldDraw call getting crashed</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291773#M4817</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you using customWorldDraw ?, if so you need to initialize them properly, you need to call &lt;CODE&gt;::rxInit&lt;/CODE&gt; of &lt;CODE&gt;AcRxObject &lt;/CODE&gt;derived classes. And&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt; acrxBuildClassHierarchy(); &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;
vsavAcGiWorldDraw::rxInit();
				vsavAcGiContext::rxInit();
				vsavAcGiWorldGeometry::rxInit();
				vsavAcGiSubEntityTraits::rxInit();&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Test code&lt;/P&gt;
&lt;PRE&gt;//--------------------------------//
//  [1/14/2020 moogalm]
class vsavAcGiContext : public AcGiContext
{
public:
	ACRX_DECLARE_MEMBERS(vsavAcGiContext);

	virtual Adesk::Boolean  isPsOut() const { return Adesk::kFalse; }
	virtual Adesk::Boolean  isPlotGeneration() const { return Adesk::kFalse; }
	virtual AcDbDatabase* database() const { return acdbHostApplicationServices()-&amp;gt;workingDatabase(); }
	virtual bool            isBoundaryClipping() const { return false; }
	virtual void            disableFastMoveDrag() const {};
	virtual bool            isNesting() const { return false; }
	virtual AcCmEntityColor   effectiveColor() const { return AcCmEntityColor(); }
	virtual AcDb::LineWeight  byBlockLineWeight() const { return AcDb::LineWeight::kLnWt000; }
	virtual AcDbObjectId      byBlockPlotStyleNameId() const { return AcDbObjectId::kNull; }
	virtual bool              supportsTrueTypeText() { return false; }
};

class vsavAcGiSubEntityTraits : public AcGiSubEntityTraits
{
protected:
public:
	ACRX_DECLARE_MEMBERS(vsavAcGiSubEntityTraits);

	virtual void setColor(const Adesk::UInt16 color) {}
	virtual void setTrueColor(const AcCmEntityColor&amp;amp; color) {}
	virtual void setLayer(const AcDbObjectId layerId) {}
	virtual void setLineType(const AcDbObjectId linetypeId) {}
	virtual void setSelectionMarker(const Adesk::LongPtr markerId) {}
	virtual void setFillType(const AcGiFillType fillType) {}
	virtual void setLineWeight(const AcDb::LineWeight lw) {}
	virtual void setLineTypeScale(double dScale = 1.0) {}
	virtual void setMaterial(const AcDbObjectId materialId) {}
	virtual void setPlotStyleName(AcDb::PlotStyleNameType type, const AcDbObjectId&amp;amp; id = AcDbObjectId::kNull) {}
	virtual void setThickness(double dThickness) {}
	virtual Adesk::UInt16 color() const { return 0; }
	virtual AcCmEntityColor trueColor() const { return m_color; }
	virtual AcDbObjectId layerId() const { return AcDbObjectId::kNull; }
	virtual AcDbObjectId        lineTypeId() const { return AcDbObjectId::kNull; }
	virtual AcGiFillType        fillType() const { return AcGiFillType::kAcGiFillNever; }
	virtual AcDb::LineWeight       lineWeight() const { return AcDb::LineWeight::kLnWt000; }
	virtual double lineTypeScale() const { return 1.0; }
	virtual AcDbObjectId materialId() const { return AcDbObjectId::kNull; }
	double thickness() const { return 0.0; }
	virtual AcDb::PlotStyleNameType     getPlotStyleNameId(AcDbObjectId&amp;amp; idResult) const { return AcDb::kPlotStyleNameByLayer; }
	AcCmEntityColor m_color;
};


class vsavAcGiWorldGeometry : public AcGiWorldGeometry
{
public:
	ACRX_DECLARE_MEMBERS(vsavAcGiWorldGeometry);


	virtual void getModelToWorldTransform(AcGeMatrix3d&amp;amp; matrix) const {}
	virtual void getWorldToModelTransform(AcGeMatrix3d&amp;amp; matrix) const {}
	virtual Adesk::Boolean pushModelTransform(const AcGeVector3d&amp;amp; vNormal) { return Adesk::kTrue; }
	virtual Adesk::Boolean pushModelTransform(const AcGeMatrix3d&amp;amp; xMat) { return Adesk::kTrue; }
	virtual Adesk::Boolean popModelTransform() { return Adesk::kTrue; }
	AcGeMatrix3d pushPositionTransform(AcGiPositionTransformBehavior behavior, const AcGePoint3d&amp;amp; offset) { return AcGeMatrix3d::kIdentity; }
	AcGeMatrix3d pushPositionTransform(AcGiPositionTransformBehavior behavior, const AcGePoint2d&amp;amp; offset) { return AcGeMatrix3d::kIdentity; }
	AcGeMatrix3d pushScaleTransform(AcGiScaleTransformBehavior behavior, const AcGePoint3d&amp;amp; extents) { return AcGeMatrix3d::kIdentity; }
	AcGeMatrix3d pushScaleTransform(AcGiScaleTransformBehavior behavior, const AcGePoint2d&amp;amp; extents) { return AcGeMatrix3d::kIdentity; }
	AcGeMatrix3d pushOrientationTransform(AcGiOrientationTransformBehavior behavior) { return AcGeMatrix3d::kIdentity; }
	virtual Adesk::Boolean edge(const AcArray&amp;lt;AcGeCurve2d*&amp;gt;&amp;amp; edges) const { return Adesk::kFalse; }
	virtual Adesk::Boolean  circle(const AcGePoint3d&amp;amp; center, const double radius, const AcGeVector3d&amp;amp; normal) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  circle(const AcGePoint3d&amp;amp; p1, const AcGePoint3d&amp;amp; p2, const AcGePoint3d&amp;amp; p3) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  circularArc(const AcGePoint3d&amp;amp; center, const double radius, const AcGeVector3d&amp;amp; normal, const AcGeVector3d&amp;amp; startVector, const double sweepAngle, const AcGiArcType arcType = kAcGiArcSimple) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  circularArc(const AcGePoint3d&amp;amp; start, const AcGePoint3d&amp;amp; point, const AcGePoint3d&amp;amp; end, const AcGiArcType arcType = kAcGiArcSimple) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  polyline(const Adesk::UInt32 nbPoints, const AcGePoint3d* pVertexList, const AcGeVector3d* pNormal = NULL, Adesk::LongPtr lBaseSubEntMarker = -1) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  polyline(const AcGiPolyline&amp;amp; polylineObj) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  polyPolyline(Adesk::UInt32 nbPolylines, const AcGiPolyline* pPolylines) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  polygon(const Adesk::UInt32 nbPoints, const AcGePoint3d* pVertexList) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  polyPolygon(const Adesk::UInt32 numPolygonIndices, const Adesk::UInt32* numPolygonPositions, const AcGePoint3d* polygonPositions, const Adesk::UInt32* numPolygonPoints, const AcGePoint3d* polygonPoints, const AcCmEntityColor* outlineColors = NULL, const AcGiLineType* outlineTypes = NULL, const AcCmEntityColor* fillColors = NULL, const AcCmTransparency* fillOpacities = NULL) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  mesh(const Adesk::UInt32 rows, const Adesk::UInt32 columns, const AcGePoint3d* pVertexList, const AcGiEdgeData* pEdgeData = NULL, const AcGiFaceData* pFaceData = NULL, const AcGiVertexData* pVertexData = NULL, const bool bAutoGenerateNormals = true) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  shell(const Adesk::UInt32 nbVertex, const AcGePoint3d* pVertexList, const Adesk::UInt32 faceListSize, const Adesk::Int32* pFaceList, const AcGiEdgeData* pEdgeData = NULL, const AcGiFaceData* pFaceData = NULL, const AcGiVertexData* pVertexData = NULL, const struct resbuf* pResBuf = NULL, const bool bAutoGenerateNormals = true) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  text(const AcGePoint3d&amp;amp; position, const AcGeVector3d&amp;amp; normal, const AcGeVector3d&amp;amp; direction, const double height, const double width, const double oblique, const TCHAR* pMsg) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  text(const AcGePoint3d&amp;amp; position, const AcGeVector3d&amp;amp; normal, const AcGeVector3d&amp;amp; direction, const TCHAR* pMsg, const Adesk::Int32 length, const Adesk::Boolean raw, const AcGiTextStyle&amp;amp; pTextStyle) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  xline(const AcGePoint3d&amp;amp; p1, const AcGePoint3d&amp;amp; p2) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  ray(const AcGePoint3d&amp;amp; p1, const AcGePoint3d&amp;amp; p2) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  pline(const AcDbPolyline&amp;amp; lwBuf, Adesk::UInt32 fromIndex, Adesk::UInt32 numSegs) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  draw(AcGiDrawable* pDrawable) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  image(const AcGiImageBGRA32&amp;amp; imageSource, const AcGePoint3d&amp;amp; position, const AcGeVector3d&amp;amp; u, const AcGeVector3d&amp;amp; v, TransparencyMode transparencyMode = kTransparency8Bit) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  rowOfDots(int count, const AcGePoint3d&amp;amp; start, const AcGeVector3d&amp;amp; step) const { return Adesk::kTrue; }
	virtual Adesk::Boolean  ellipticalArc(const AcGePoint3d&amp;amp; center, const AcGeVector3d&amp;amp; normal, double majorAxisLength, double minorAxisLength, double startDegreeInRads, double endDegreeInRads, double tiltDegreeInRads, AcGiArcType arcType = kAcGiArcSimple) const { return Adesk::kTrue; }
	virtual Adesk::Boolean pushClipBoundary(AcGiClipBoundary* pBoundary) { return Adesk::kTrue; }
	virtual void popClipBoundary() {}
	virtual Adesk::Boolean worldLine(const AcGePoint3d pnts[2]) { return Adesk::kTrue; }
	virtual void setExtents(AcGePoint3d* pNewExtents) const {}
};

class vsavAcGiWorldDraw : public AcGiWorldDraw
{
public:
	ACRX_DECLARE_MEMBERS(vsavAcGiWorldDraw);
	vsavAcGiWorldDraw();
	virtual             ~vsavAcGiWorldDraw() {};

	// von AcGiCommonDraw
	virtual AcGiRegenType           regenType() const;
	virtual Adesk::Boolean          regenAbort() const;
	virtual AcGiSubEntityTraits&amp;amp; subEntityTraits() const;
	virtual AcGiGeometry* rawGeometry() const;
	virtual Adesk::Boolean          isDragging() const;

	// This function operates against the current active viewport
	//
	virtual double                deviation(const AcGiDeviationType,
		const AcGePoint3d&amp;amp;) const;
	virtual Adesk::UInt32           numberOfIsolines() const;

	virtual AcGiContext* context(); /*NEW*/


	// von AcGiWorldDraw
	virtual AcGiWorldGeometry&amp;amp; geometry() const;

	// 	linAcGiContext					m_context;
	// 	linAcGiWorldGeometry		m_geometry;
	// 
	// 	AcGiRegenType						m_regenType;
	// 	double									m_deviation;
};

ACRX_NO_CONS_DEFINE_MEMBERS(vsavAcGiContext, AcGiContext)
ACRX_NO_CONS_DEFINE_MEMBERS(vsavAcGiWorldGeometry, AcGiWorldGeometry)
ACRX_NO_CONS_DEFINE_MEMBERS(vsavAcGiSubEntityTraits, AcGiSubEntityTraits)
static vsavAcGiContext cntxt;
static vsavAcGiSubEntityTraits traits;
static vsavAcGiWorldGeometry geom;
ACRX_NO_CONS_DEFINE_MEMBERS(vsavAcGiWorldDraw, AcGiWorldDraw);

vsavAcGiWorldDraw::vsavAcGiWorldDraw() : AcGiWorldDraw() {}
AcGiRegenType vsavAcGiWorldDraw::regenType() const { return kAcGiStandardDisplay; }
Adesk::Boolean vsavAcGiWorldDraw::regenAbort() const { return Adesk::kFalse; }
AcGiSubEntityTraits&amp;amp; vsavAcGiWorldDraw::subEntityTraits() const { return traits; }
AcGiGeometry* vsavAcGiWorldDraw::rawGeometry() const { return &amp;amp;geom; }
Adesk::Boolean vsavAcGiWorldDraw::isDragging() const { return Adesk::kFalse; }
double vsavAcGiWorldDraw::deviation(const AcGiDeviationType, const AcGePoint3d&amp;amp;) const { return 1000.0; }
Adesk::UInt32 vsavAcGiWorldDraw::numberOfIsolines() const { return 3; }
AcGiContext* vsavAcGiWorldDraw::context() { return &amp;amp;cntxt; }
AcGiWorldGeometry&amp;amp; vsavAcGiWorldDraw::geometry() const { return geom; }

//--------------//


extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* appId)
{
        switch (msg) {
        case AcRx::kInitAppMsg:
		       acrxDynamicLinker-&amp;gt;unlockApplication(appId);
				acrxDynamicLinker-&amp;gt;registerAppMDIAware(appId);
				
				vsavAcGiWorldDraw::rxInit();
				vsavAcGiContext::rxInit();
				vsavAcGiWorldGeometry::rxInit();
				vsavAcGiSubEntityTraits::rxInit();
				
				acrxBuildClassHierarchy();

                initApp();
				
                break;
        case AcRx::kUnloadAppMsg:
                unloadApp();
        }
        return AcRx::kRetOK;
}
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 05:40:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291773#M4817</guid>
      <dc:creator>moogalm</dc:creator>
      <dc:date>2020-02-03T05:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: worldDraw call getting crashed</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291789#M4818</link>
      <description>&lt;P&gt;No ! I am not using custom worldDraw , I am simply casting the AcDbEntity to AcDb3dSolid and then calling the worldDraw over AcDb3dSolid .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Adesk::Boolean doViewport;
ExampleCustomWorldDraw *world = new ExampleCustomWorldDraw (&amp;amp;lpoints,regiontype);

doViewport = const_cast&amp;lt;AcDbEntity*&amp;gt;(pEnt)-&amp;gt;worldDraw(world);
//The application gets crashed at this line.
// I even tried to call rxInit over ExampleCustomWorldDraw but still it crashes.
Exception thrown at 0x00007FFAC305EDD4 (ac1st24.dll) in acad.exe: &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 06:29:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291789#M4818</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-03T06:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: worldDraw call getting crashed</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291876#M4819</link>
      <description>&lt;P&gt;Yeah, you are using custom worldDraw, to recieve entity's worldDraw calls, passing solid's worldDraw call to your derived worldDraw.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to initialize these in your arx entry point as I shown above.&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt; ExampleCustomWorldDraw ::rxInit();&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;acrxBuildClassHierachy()&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;Please share a code snippet which I can reproduce the behavior at my end.&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 07:22:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291876#M4819</guid>
      <dc:creator>moogalm</dc:creator>
      <dc:date>2020-02-03T07:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: worldDraw call getting crashed</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291895#M4820</link>
      <description>&lt;PRE&gt;   AcGePoint3dArray lpoints(100,1000);
 const AcGiRegenType type = kAcGiHideOrShadeCommand ;
 //class  ExampleCustomWorldDraw : public AcGiWorldDraw 
 ExampleCustomWorldDraw *world = new ExampleCustomWorldDraw(&amp;amp;lpoints,type);
    if(world)
    {
        AcGeMatrix3d xform ; // some transform matrix calculated elswhere 
  world-&amp;gt;geometry().pushModelTransform(xform);
  doViewport = const_cast&amp;lt;AcDbEntity*&amp;gt;(pEnt)-&amp;gt;worldDraw(world); // here the application crashes .
  // I am working on the latest API provided for Autocad Release Candidate Rogue version 
  
 }&lt;/PRE&gt;&lt;P&gt;May be this helps .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 07:39:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291895#M4820</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-03T07:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: worldDraw call getting crashed</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291966#M4821</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;I am working on the latest API provided for Autocad Release Candidate Rogue version &lt;/PRE&gt;
&lt;P&gt;What is that latest API you are working on ? Can you please put your complete code which I can replicate ? you can use ents_dg sample from SDK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 08:43:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9291966#M4821</guid>
      <dc:creator>moogalm</dc:creator>
      <dc:date>2020-02-03T08:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: worldDraw call getting crashed</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9300888#M4822</link>
      <description>&lt;P&gt;&lt;FONT&gt;I have a function callDrawMethod&lt;/FONT&gt;() that takes const AcDbEntity and some other arguments such as&amp;nbsp;&lt;FONT&gt;AcGePoint3dArray&lt;/FONT&gt;, deviation ,&amp;nbsp;&lt;FONT&gt;AcGiRegenType&lt;/FONT&gt; etc .&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Also there is a customWorldDraw variable named as world of Class ExfTranCustomWorldDraw derived from AcGiWorldDraw class which is passed to the worldDraw .&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Adesk::Boolean doViewport = const_cast&amp;lt;AcDbEntity*&amp;gt;(pEnt)-&amp;gt;worldDraw(world);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Now if the pEnt which is actually AcDb3dSolid derived from AcDbEntity calls worldDraw ie above code it crashes .&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;static bool callDrawMethod(const AcDbEntity *pEnt,AcGePoint3dArray &amp;amp;points,
                           bool isEaiObject,double mainDeviation = 1.0,
                           const AcGiRegenType type = kAcGiHideOrShadeCommand,
						   bool bBlkRef = false)
{   
    Adesk::Boolean doViewport;
	
    AcGePoint3dArray lpoints(100,1000);
    static double deviation = getDeviation();
    if(isEaiObject &amp;amp;&amp;amp; !isTooling(pEnt))
    {
        deviation = mainDeviation; 
	}
	else
	{
		if(deviation &amp;lt; 1e-5)
		{
			deviation = getDeviation();
		}
		else
		{
			deviation = mainDeviation; 
		}
	}

	//ExampleTranCustomWorldDraw::rxInit();  

	ExampleTranCustomWorldDraw *world = new ExampleTranCustomWorldDraw(&amp;amp;lpoints,type);
    if(world)
    {
        world-&amp;gt;setUseMatrix(true);
		if(!bBlkRef)
        {
			world-&amp;gt;geometry().pushModelTransform(ExampleTranDataMgr.docData().BaseXform);
		}
        world-&amp;gt;setDeviation(deviation);
		if (!pEnt-&amp;gt;isKindOf(AcDb3dSolid::desc())) {
			doViewport = const_cast&amp;lt;AcDbEntity*&amp;gt;(pEnt)-&amp;gt;worldDraw(world);// code crashes here 
		}
		else
		{
			//ExampleTranCustomWorldDraw::rxInit();
			//world-&amp;gt;rxInit();
			doViewport = const_cast&amp;lt;AcDbEntity*&amp;gt;(pEnt)-&amp;gt;worldDraw(world);
		}&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:33:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9300888#M4822</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-06T13:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: worldDraw call getting crashed</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9301035#M4823</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to call &lt;CODE&gt;ExampleTranCustomWorldDraw::rxInit &lt;/CODE&gt; in arx entry point in your app initailization switch&lt;/P&gt;
&lt;P&gt;See below&lt;/P&gt;
&lt;PRE style="color: #d1d1d1; background: #000000;"&gt;&lt;SPAN style="color: #e66170; font-weight: bold;"&gt;extern&lt;/SPAN&gt; &lt;SPAN style="color: #02d045;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #00c4c4;"&gt;C&lt;/SPAN&gt;&lt;SPAN style="color: #02d045;"&gt;"&lt;/SPAN&gt; AcRx&lt;SPAN style="color: #b060b0;"&gt;::&lt;/SPAN&gt;AppRetCode
acrxEntryPoint&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;AcRx&lt;SPAN style="color: #b060b0;"&gt;::&lt;/SPAN&gt;AppMsgCode msg&lt;SPAN style="color: #d2cd86;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #e66170; font-weight: bold;"&gt;void&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;*&lt;/SPAN&gt; appId&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: #b060b0;"&gt;{&lt;/SPAN&gt;
        &lt;SPAN style="color: #e66170; font-weight: bold;"&gt;switch&lt;/SPAN&gt; &lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;msg&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: #b060b0;"&gt;{&lt;/SPAN&gt;
        &lt;SPAN style="color: #e66170; font-weight: bold;"&gt;case &lt;/SPAN&gt;&lt;SPAN style="color: #007d45;"&gt;AcRx&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;::&lt;/SPAN&gt;&lt;SPAN style="color: #007d45;"&gt;kInitAppMsg&lt;/SPAN&gt;&lt;SPAN style="color: #e34adc;"&gt;:&lt;/SPAN&gt;
		       acrxDynamicLinker&lt;SPAN style="color: #d2cd86;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;&amp;gt;&lt;/SPAN&gt;unlockApplication&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;appId&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
				acrxDynamicLinker&lt;SPAN style="color: #d2cd86;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;&amp;gt;&lt;/SPAN&gt;registerAppMDIAware&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;appId&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
				
				&lt;SPAN style="color: red;"&gt;ExampleTranCustomWorldDraw &lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;::&lt;/SPAN&gt;&lt;SPAN style="color: red;"&gt;rxInit&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
				
				acrxBuildClassHierarchy&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;

                initApp&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
				
                &lt;SPAN style="color: #e66170; font-weight: bold;"&gt;break&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
        &lt;SPAN style="color: #e66170; font-weight: bold;"&gt;case &lt;/SPAN&gt;&lt;SPAN style="color: #007d45;"&gt;AcRx&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;::&lt;/SPAN&gt;&lt;SPAN style="color: #007d45;"&gt;kUnloadAppMsg&lt;/SPAN&gt;&lt;SPAN style="color: #e34adc;"&gt;:&lt;/SPAN&gt;
                unloadApp&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
        &lt;SPAN style="color: #b060b0;"&gt;}&lt;/SPAN&gt;
        &lt;SPAN style="color: #e66170; font-weight: bold;"&gt;return&lt;/SPAN&gt; AcRx&lt;SPAN style="color: #b060b0;"&gt;::&lt;/SPAN&gt;kRetOK&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
&lt;SPAN style="color: #b060b0;"&gt;}&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;!--Created using ToHtml.com on 2020-02-06 14:16:29 UTC --&gt;</description>
      <pubDate>Thu, 06 Feb 2020 14:19:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9301035#M4823</guid>
      <dc:creator>moogalm</dc:creator>
      <dc:date>2020-02-06T14:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: worldDraw call getting crashed</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9301111#M4824</link>
      <description>Thanks I will check and let you know.&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Feb 2020 14:49:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9301111#M4824</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-06T14:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: worldDraw call getting crashed</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9302507#M4825</link>
      <description>&lt;P&gt;yes I have called the rxInit in the entrypoint , still the issue persist .&lt;/P&gt;&lt;PRE&gt;extern "C" __declspec(dllexport) AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pPkt)
{
	ExampleTranCustomWorldDraw::rxInit(); 
	acrxBuildClassHierarchy();
	return AcRx::kRetOK
}

&lt;/PRE&gt;&lt;P&gt;&lt;FONT&gt;so while calling this function:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;doViewport = const_cast&amp;lt;AcDbEntity*&amp;gt;(pEnt)-&amp;gt;worldDraw(world);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;An exception is triggred as shown below :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Unhandled exception at 0x00007FFABF50EDD4 (ac1st24.dll) in acad.exe: 0xC0000005: Access violation reading location 0x0000000000000008. occurred&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Also it uses the given library with the given version as mentioned below :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;AcGeomentObj.dbx&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;24.0.46.0.101&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 06:10:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9302507#M4825</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T06:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: worldDraw call getting crashed</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9303129#M4826</link>
      <description>&lt;P&gt;&lt;FONT&gt;Thanks, Madhukar for being so active on the thread and yes you have paved the way to the solution. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;The answer was hiding behind rxInit() only .&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Following are the changes done by me :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Custom class derived over AcGiContext was initialized in the following manner earlier :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;ACRX_DEFINE_MEMBERS(CustomTranAcGiContext);&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;which I changed now to ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;ACRX_NO_CONS_DEFINE_MEMBERS(&lt;FONT&gt;CustomTranAcGiContext&lt;/FONT&gt;, AcGiContext);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;And&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;CustomTranAcGiContext&lt;/FONT&gt;&lt;/FONT&gt;::rxInit(); was called inside the InitApp and then&amp;nbsp;acrxBuildClassHierarchy(); was called and we are done .&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Thanks again &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 12:14:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/worlddraw-call-getting-crashed/m-p/9303129#M4826</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T12:14:34Z</dc:date>
    </item>
  </channel>
</rss>

