Graphic changes in AutoCAD 2015:

By Virupaksha Aithal

Below are some of the important Graphic changes with respect to AutoCAD 2015.

To create “CreateAutoCADOffScreenDevice”

.NET

KernelDescriptor descriptor  = new KernelDescriptor();

descriptor.addRequirement(Autodesk.AutoCAD.UniqueString.Intern("3D Drawing"));

GraphicsKernel kernal = Manager.AcquireGraphicsKernel(descriptor);

Device dev = gsm.CreateAutoCADOffScreenDevice(kernal);

ObjectARX:

descriptor.addRequirement(AcGsKernelDescriptor::k3DDrawing);
AcGsGraphicsKernel *pGraphicsKernel =
AcGsManager::acquireGraphicsKernel(descriptor);

AcGsDevice *offDevice = pGraphicsKernel->createOffScreenDevice();

To create “CreateAutoCADModel”

.NET

Model model = gsm.CreateAutoCADModel(kernal);

ObjectARX:

AcGsModel pModel = gsManager->createAutoCADModel(pGraphicsKernel);

Regarding Autodesk.AutoCAD.GraphicsSystem.RenderMode:

RenderMode is retried now. Use visual style in View.

.NET

view.VisualStyle = new VisualStyle(VisualStyleType.Realistic);

ObjectARX:

pView->setVisualStyle(AcGiVisualStyle::kGouraud);

Download ObjectARX and .NET  Block View sample for AutoCAD 2015.


Comments

11 responses to “Graphic changes in AutoCAD 2015:”

  1. Loic Jourdan Avatar
    Loic Jourdan

    Hi,
    Thank you for the update.
    What are the corresponding modifications in the native c++ API?
    Thanks

  2. Loic Jourdan Avatar
    Loic Jourdan

    Sorry, I haven’t seen the reference to ObjectArx block view sample.

  3. Hi Loic,
    I have updated the blog with ObjectARX code
    Thanks
    Viru

  4. Hi Loic,
    Please refer final line of blog, which contains the hyperlinks to sample.
    Thanks
    Viru

  5. Loic Jourdan Avatar
    Loic Jourdan

    Excellent, thanks a lot!
    I have some issues building (x64) block view sample arx sample with visual studio 2012 update 4.
    It builds correctly (only a warning below) but it results in a curiously small AsdkBlockView.arx (21KB) which is not loadable within acad.
    I’ve tried loaded it into depenency walker to see what dependency is eventually missing and it gave me a strange result: I see no dependencies to acad or one of its libraries, only dependencies to mfc, crt and kernel (?!)
    BTW, can you confirm (or invalidate) that passing false as last argument of CreateAtilImage call at the end of AsdkRenderOffScreen fails to render image using pView->getSnapShot ?
    Thanks a lot.
    The warning I got (looks ok, similar to those I got with former versions)
    rxapi.lib(nullobid.obj) : warning LNK4254: section ‘rxapi’ (C0000040) merged into ‘.rdata’ (40000040) with different attributes

  6. Hi Virupaksha,
    How do you create a Acgsview?
    Do I have to create the Graphics Kernel, etc.? In old code, I am simply using acgsGetGsView. But that seems like deprecated.
    Thanks,
    K

  7. I am using GsPreviewCtrl (from an earlier ARX example) and I followed the methods above. However, when trying to compile, I get the following:
    GsPreviewCtrl.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: static class AcUniqueString const * const AcGsKernelDescriptor::k3DDrawing”
    GsPreviewCtrl.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: static class AcGsGraphicsKernel * __cdecl AcGsManager::acquireGraphicsKernel
    When I look into gs.h, I see “DRAWBRIDGE_API” being defined. What is this? What reference am I missing. Please help – very frustrated, cannot get this nice preview class to work anymore!
    Regards,
    JP

  8. Hi,
    Please add reference to AcDrawBridge.lib.
    Thanks
    Viru

  9. Volodymyr Avatar
    Volodymyr

    Is it possible to run this sample on AutoCAD 2014?

  10. Hello,
    is there a (simple) way to show the ViewCube in the View, or at least mimic it in some manner?
    Thanks,
    Daniel

  11. 양익범 Avatar
    양익범

    나는 여기가 처음이라서 사용하는것이 많이 어렵습니다.
    나는 objectarx개발자이다.
    샘플에 존재하는 blockView를 참조하여 개발하고 있다.
    AcGsView::setViewport의 기능이 autocad 2018,2019,2020에서는 만족 스럽게 잘 작동하였다.
    그러나 autocad가 upgrade되면서 만족 스럽지 않게 작동을 한다.
    하위 버전에서 정상적으로 작동하는것이 autocad가 업그레이드 되면서 폐기 하게 되었다.
    기능이 upgrade가 되었으면 그것에 대한 설명이나 샘플코드가 유첨되어야 할것인데..
    1993년 autocad 10을 처음 사용하면서 지금까지만족스러웠는데.. 많은 아쉬움이 생겼습니다.
    혹시 upgrage된것에 대한 내용에 대한 답변을 해주실수 있다면
    yang8570@naver.com으로 부탁을 드리겠습니다.
    감사합니다.

Leave a Reply to JeanPierreCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading