• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Navisworks API

    Reply
    New Member
    Posts: 2
    Registered: ‎06-19-2012

    How to extract the viewpoints from the clash analysis results?

    150 Views, 3 Replies
    06-20-2012 12:18 AM

    hi, here, i want to use the viewpoints data contained in the clash detection results in Navisworks2013, but the api didn't provide any methods to access those data,so is there anyone can tell me how to extract the viewpoints data from those clash results?

    Please use plain text.
    ADN Support Specialist
    xiaodong.liang
    Posts: 861
    Registered: ‎06-12-2011

    Re: How to extract the viewpoints from the clash analysis results?

    07-26-2012 06:26 AM in reply to: lible0219

    Hi,

     

    yes, this is not exposed. Sorry for the bad news. But you can still use COM API to get it:

     

    InwOclTestResult.ViewPoint



    Xiaodong Liang
    Developer Technical Services
    Autodesk Developer Network

    Please use plain text.
    Active Member
    BBoretzky
    Posts: 7
    Registered: ‎09-02-2011

    Re: How to extract the viewpoints from the clash analysis results?

    09-06-2012 04:29 PM in reply to: xiaodong.liang

    Unfortunately the "it worked in the old version" doesn't really help people who's entire code base is written in the old API.  I have figured out a way to find a clashes viewpoint by creating a new viewpoint via...

     

    Viewpoint vp = new Viewpoint();

     

    then these 2 lines...

     

    vp.Position = new Point3D(clashResult.Center.X+75, clashResult.Center.Y+30, clashResult.Center.Z-10); 
    vp.PointAt(new Point3D(clashResult.Center.X, clashResult.Center.Y, clashResult.Center.Z));

     

    will make 'vp' the clashes viewpoint.

     

    However the functionality is still below average at best because even viewpoint lacks all the functionality of the InwOpAnonView and InwNvViewpoint.

     

    For instance is there a way to recreate this code block with the new Viewpoint class??

     

    var vpdAnonView = (InwOpAnonView)VpdPluginLauncher.pluginState.ObjectFactory
    (nwEObjectType.eObjectType_nwOpAnonView, null, null);

     

    vpdAnonView.ViewPoint = myViewpoint;


    Bitmap pic = Microsoft.VisualBasic.Compatibility.VB6.Support.IPictureToImage
    (VpdPluginLauncher.pluginState.CreatePicture(vpdAnonView, 1, 800, 800)) as Bitmap;

     

     

    so that I can create a picture of the viewpoint.

     

    I'm getting tired of the answers to 2013 api questions being, "ya we didn't expose that in the new Api, but you can use it in the old api".  Then why did you even build a new API to expose more functionality and a better question why did you not create functionality to be able to convert the old ClashResult objects and old Viewpoint objects to the new api.  It seems to me all you did was rearrange classes expose new functionality and then hide old functionality, it makes no sense.

    Please use plain text.
    ADN Support Specialist
    xiaodong.liang
    Posts: 861
    Registered: ‎06-12-2011

    Re: How to extract the viewpoints from the clash analysis results?

    09-12-2012 12:13 AM in reply to: BBoretzky

    Hi BBoretzky,

     

    Thanks for your comments.

     

    Firstly, could you take a look if the other post helps a bit?

    http://forums.autodesk.com/t5/Autodesk-Navisworks-API/Clash-image/m-p/3598862#M599

     

     

    The .NET  API is NOT just a rearrangement of the existing COM API and wrap them. It  encapsulates the core code of C++. I believe there is some considerations that our engineer team did not expose the ability of exporting viewpoint /clash image. Sometimes, it would not mean it is a small job, though it looks the old COM API has the similar ability. Or probably it may happen not to be in the bucket in this release. We have had a wish to ask the ability to export image of clash result in .NET API. I cannot gurantee, however I appreciate your understanding and patience. I also welcome you join the annual survey of API wish which would happen in mid-year. The survey of this year for the next release has ended.

     

     



    Xiaodong Liang
    Developer Technical Services
    Autodesk Developer Network

    Please use plain text.