Instant Autodesk AutoCAD 2014 Customization with .NET by Tom Nelson

Instant Autodesk AutoCAD 2014 Customization with .NET by Tom Nelson

Author:Tom Nelson [Nelson, Tom]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2013-09-25T04:00:00+00:00


If your appid exists in the table, retrieve the xdata from the selected object. Use a ResultBuffer to capture the xdata. Loop through the buffer, testing each item for its xdata type code. Display the xdata (adding some descriptive information) in AutoCAD's textscreen (press the F2 key to toggle the textscreen visibility):if (regTable.Has("TEST")) { //Replace "TEST" with your own appid //If the appid exists in the regapp table, attempt to read the //object's xdata from the table ResultBuffer resBuf = acEnt.GetXDataForApplication("TEST"); if (resBuf != null) { TypedValue[] resBufArray = resBuf.AsArray(); foreach (TypedValue val in resBufArray) { switch ((DxfCode)val.TypeCode) { //Appid type xdata case DxfCode.ExtendedDataRegAppName: string appid = (string)val.Value; ed.WriteMessage(System.Environment.NewLine + "1001 AppId: {0}", appid); break; //String type xdata case DxfCode.ExtendedDataAsciiString: string strng = (string)val.Value; ed.WriteMessage(System.Environment.NewLine + "1000 String: {0}", strng); break; //LayerName type xdata case DxfCode.ExtendedDataLayerName: string laynam = (string)val.Value; ed.WriteMessage(System.Environment.NewLine + "1003 Layer: {0}", laynam); break; //Handle type xdata case DxfCode.ExtendedDataHandle: ed.WriteMessage(System.Environment.NewLine + "1005 Handle: {0}", val.Value); break; //Control type xdata case DxfCode.ExtendedDataControlString: string brkt = (string)val.Value; ed.WriteMessage(System.Environment.NewLine + "1002 Control: {0}", brkt); break; //Integer type xdata case DxfCode.ExtendedDataInteger16: Int16 intgr = (short)val.Value; ed.WriteMessage(System.Environment.NewLine + "1070 Integer: {0}", intgr); break; default: ed.WriteMessage(System.Environment.NewLine + "Unknown type: {0}", val.Value); break; }//switch }//foreach } else { ed.WriteMessage(System.Environment.NewLine + "No xdata found for appid: TEST"); } trans.Commit(); } else { ed.WriteMessage(System.Environment.NewLine + "No xdata found for appid: TEST"); }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Popular ebooks
Deep Learning with Python by François Chollet(12571)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7782)
Autodesk Civil 3D 2024 from Start to Finish by Stephen Walz Tony Sabat(6526)
Mathematics for Game Programming and Computer Graphics by Penny de Byl(6401)
Taking Blender to the Next Level by Ruan Lotter(6182)
Express Your Creativity with Adobe Express by Rosie Sue(6008)
Hands-On Unity 2022 Game Development - Third Edition by Nicolas Alejandro Borromeo(5624)
Hands-On Unity 2022 Game Development by Nicolas Alejandro Borromeo(4745)
Adobe Illustrator for Creative Professionals by Clint Balsar(3678)
Unreal Engine 5 Character Creation, Animation, and Cinematics by Henk Venter & Wilhelm Ogterop(3615)
Going the Distance with Babylon.js by Josh Elster(3583)
Mastering Graphics Programming with Vulkan by Marco Castorina & Gabriel Sassone(3487)
Squeaky Clean Topology in Blender by Michael Steppig(3421)
Drawing Shortcuts: Developing Quick Drawing Skills Using Today's Technology by Leggitt Jim(2910)
Unreal Engine 5 Character Creation, Animation, and Cinematics by Henk Venter
 Wilhelm Ogterop(2872)
Rapid Viz: A New Method for the Rapid Visualization of Ideas by Kurt Hanks & Larry Belliston(2700)
The 46 Rules of Genius: An Innovator's Guide to Creativity (Voices That Matter) by Marty Neumeier(2655)
Learn Qt 5: Build modern, responsive cross-platform desktop applications with Qt, C++, and QML by Nicholas Sherriff(2365)
Fusion 360 for Makers by Lydia Sloan Cline(2220)
Hands-On Neural Networks with Keras by Niloy Purkait(2168)