Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can I get the Point3D when click?

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
pollyanna23
2054 Views, 6 Replies

Can I get the Point3D when click?

Hi,

 

Can I get the Point3D of wherever I click in the model just like the measure tool? I just know I can get the screen coordinate X and Y.

 

 

Thanks!

 

Anna

6 REPLIES 6
Message 2 of 7

Hi,

 

so, as said in the other post, the new plugin InputPlugin or ToolPlugin allows you to get the picked point:

 

 public override bool MouseDown(
            //the current view when mouse down
            View view, 
            //Enumerates key modifiers used in input:
            //None, Ctrl,Alt,Shift
            KeyModifiers modifiers,
            //left mouse button:1,
            //middle mouse button:2,
            //right mouse button:3
            ushort button,
            //screen coordinate x
            int x,
            //screen coordinate y
            int y, 
            // not clear to me :-( 
            double timeOffset)
        {
            // key modifiers used in input
            Debug.Print(modifiers.ToString());
            //left/middle mouse
            Debug.Print(button.ToString());
            //timeOffset
            Debug.Print(timeOffset.ToString());
 
            // get info of selecting
            PickItemResult itemResult = 
                         view.PickItemFromPoint(x, y);
 
            if (itemResult != null)
            { 
                //selected point in WCS
               string oStr = string.Format( 
                "{0},{1},{2}", itemResult.Point.X,
                              itemResult.Point.Y,
                              itemResult.Point.Z);
               Debug.Print(oStr);
 
                //selected object
                ModelItem modelItem = itemResult.ModelItem;
                System.Windows.Forms.MessageBox.Show ( 
                              modelItem.ClassDisplayName);
            }
 
            return false;
        }

 

Message 3 of 7
alankong
in reply to: xiaodong_liang

Xiaodong ,

 

Is it only available in 2014?

 

How about in API viewcontrol? Is it possible to get mouse click XYZ point too?

Message 4 of 7
xiaodong_liang
in reply to: alankong

Hi  alankong ,

 

yes, this is a new feature of 2014.

 

Unfortunetely, the ability has not been exposed with application of .NET control.

Message 5 of 7
JohnHon
in reply to: xiaodong_liang

Dear Xiaodong,

 

Is it still not possible to get the XYZ with application in .NET?

 

Best Regards,

John

Message 6 of 7
xiaodong_liang
in reply to: JohnHon

Hi John,

sorry for late response. about getting the XYZ with application in .NET control, as far as I know, there is not any update. Sorry for the bad news.
Message 7 of 7
JohnHon
in reply to: xiaodong_liang

Hi Xiaodong,

 

It is sad to heard that.

Anyway, thanks for your update.

 

Best Regards,

John

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report