public void ImportFromKinect() { Document doc = Autodesk.AutoCAD.ApplicationServices. Application.DocumentManager.MdiActiveDocument; Editor ed = doc.Editor; KinectCombinedJig kj = new KinectCombinedJig(); kj.InitializeSpeech(); if (!kj.StartSensor()) { ed.WriteMessage( "\nUnable to start Kinect sensor - " + "are you sure it's plugged in?" ); return; } var pr = ed.Drag(kj); if (pr.Status != PromptStatus.OK) { kj.StopSensor(); return; } kj.Done = true; // Generate a final point cloud with color before stopping // the sensor kj.UpdatePointCloud(); kj.StopSensor(); AddLines(doc, kj.Lines); kj.WriteAndImportPointCloud(doc, kj.Vectors); }
public void ImportFromKinect() { Document doc = Autodesk.AutoCAD.ApplicationServices. Application.DocumentManager.MdiActiveDocument; Editor ed = doc.Editor; KinectCombinedJig kj = new KinectCombinedJig(); kj.InitializeSpeech(); if (!kj.StartSensor()) { ed.WriteMessage( "\nUnable to start Kinect sensor - " + "are you sure it's plugged in?" ); return; } PromptResult pr = ed.Drag(kj); if (pr.Status != PromptStatus.OK) { kj.StopSensor(); return; } // Generate a final point cloud with color before stopping // the sensor kj.UpdatePointCloud(); kj.StopSensor(); AddLines(doc, kj.Lines); kj.WriteAndImportPointCloud(doc, kj.Vectors); }