Using MAPTRIM in .NET Application

By Partha Sarkar

MAPTRIM is AutoCAD Map 3D's UI command. API equivalent for MAPTRIM is map_dwgtrimobj().  It is part of the C/C++ and LISP APIs. API equivalent of MAPTRIM is not yet available in .NET.

 

If you want to use MAPTRIM with necessary input parameters, you can build the command string and use SendCommand() or SendStringToExecute() to pump the command in AutoCAD Map 3D's command line.

 

Here is code snippet on how to use it for a selected layer and for all layers : 

'' Using Maptrim command through SendCommand
'' in the following example 'miscellaneous0' is the layer name for selection 
 
  Dim commandStr AsString = ".maptrim " +"s " +"l " +"y " +"miscellaneous0" + vbCr +"n " + "o " + "y " + "y " + "i " + "y "
  acApp.ActiveDocument.SendCommand(commandStr)
'' Using Maptrim command through SendCommand
'' this example is for all Layers 
Dim commandStr AsString = ".maptrim " +"s " +"l " +"n " +"n " + "o " + "y " + "y " + "i " + "y "
acApp.ActiveDocument.SendCommand(commandStr)

Comments

Leave a Reply

Discover more from Autodesk Developer Blog

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

Continue reading