Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to call FLATSHOT entirely from .NET code?

Message 1 of 9
1353 Views, 8 Replies

How to call FLATSHOT entirely from .NET code?

Hello devs, 

what is the .NET (C#) equivalent of FLATSHOT?
Does anyone have a code sample producing the following result?

1. Project a set of 3D models onto a 2D plane from an arbitrary point of view.
2. I need the projected result in "Hidden" visual style. (Hide overlaped lines)
(Just like in FLATSHOT, when "Display Hidden lines" is not chosen)

3. Save the projection as a block. (Explodable block, just like the result of a flatshot)

All of this entirely from code. No commands such as FLATSHOT, FLATTEN, etc..

Thanks for your time and effort, may the solution be helpful to everyone.

Message 2 of 9
in reply to: Anonymous

This may help:



Basicaly what is says is that you need to create a section of a solid. Apparently the section's plane doesn't need to intersect the solid.

Never used this myself though....


Message 3 of 9
in reply to: Anonymous

Native ObjectARX (C++) does have a Hidden Line Removal API (see . . . ObjectARX****-utils-HlrApi). 

.NET compatible wrapper (AutoCAD 2019+) looks to be available through the steps described here:

Managed HLR API for AutoCAD - AutoCAD DevBlog (typepad.com)




I have a project that addresses the 3d to 2d hidden line functionality, and I, too, wished to stay within the Managed ARX confines (plus I need to stay <= AutoCAD 2016). 

The endeavor was convoluted but I was able to use a virtual XPS printer setup and subsequent analysis of the file to recreate geometry - thus mimicking the desired functionality.


Though slower and more complex, this methodology allows for non Solid3d entities as well as Layer isolation.


See the 2DREN command in the screencasts in this thread (Note:  several different commands are demoed in the screencasts):


May your cursor always snap to the location intended.
Message 4 of 9
in reply to: SEANT61

@SEANT61 Sounds good, I will try the C++ part out! Thank you for your contribution!

Message 5 of 9
in reply to: Anonymous

You can try  the Flatshot command with Ed.Command 


ed.Command("_.FLATSHOT", h, "1", "1", "0");

Message 6 of 9
in reply to: insmuratturna

Does this actually work for you? Have you tried it yourself?

Message 7 of 9
in reply to: Anonymous

It is only one line command 

Why dont you try

Message 8 of 9
in reply to: insmuratturna


I have tried, and there is not such a method "Command(...);"
You should try before suggesting

Message 9 of 9
in reply to: Anonymous

Editor.Command()/CommandAsync() is available since AutoCAD 2015. So, @insmuratturna 's suggestion is certainly valid. The difference of calling Editor.Command() and Document.SendTextToExecute() is that Editor.Command can only be called in Document context.


Norman Yuan

Drive CAD With Code


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

Post to forums  

Autodesk Customer Advisory Groups

Autodesk Design & Make Report