FLATSHOT from .net

Hi,
Is there any way to call the command FLATSHOT or a native equivalent from a .net plugin?
  • ed.Command(FLATSHOT...) does not seem to work because there is no scripted mode
  • Someone suggested using (Region region = solid.GetSection(plane)){...}) but it is limited to solid3D objects, so it will be hard to manage other types and particularly blocks.

Comments

  • Unfortunately, in the AutoCAD and BricsCAD APIs, there is no way to get flatshot. You have to create and use Sections as described here: https://www.keanw.com/2008/05/sectioning-an-a.html
    Sections work great with any object, including blocks.
    However, in BricsCAD this method does not work either - there is an error in the API in the Section.GenerateSectionGeometry method - the method does not return a list of invisible contours.
  • Thanks @avc for your answer, although this is not what I expected.

    Anyone has a clean workaround? At worst I might try to control the UI with sendkeys, but this is ugly coding and i'd like to avoid this.
  • The workaround I use is to explode all objects recursively until curves are obtained. You can then project the curves onto the plane. this way you get all the edges of the solids. But you won't get the silhouettes of convex surfaces, and you won't know which edges are invisible.
    I have long been puzzled by this topic, but did not come up with anything better. Let's wait for the API extension
  • :'( too bad. Have a nice day
  • You can also PINVOKE to native and use the HLR (\utils\hlrapi) to build your own FLATSHOT command but it's quite a long journey.
  • The api for most non autocad commands is missing sadly.
    But you can allways use "sendcommand" activate the command.
    Or write a lisp script and call that from .net

    Its a crappy way of doing it but it works.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Click one of the buttons on the top bar to get involved!