Turning AutoCAD curves into Revision Clouds (AutoCAD .net API)

_config.yml

It seems a common scenario that folks want certain polylines/curves etc to turn into a revision cloud.

How do we do this?

At the end of the day, the revision cloud is nothing but a polyline. You could roll your own polyline which handles the bulges and vertices so that it looks like a revision cloud – but that takes a lot of effort – the quick and dirty way of doing so involves creating the polyline programmatically and then calling an AutoCAD command on that Polyline.

There are a few ways you can call commands:

  • Using SendStringToExecute

  • Using Editor.Command();

I prefer the latter, because it is more flexible. SendStringToExecute operates after the command is completed – which may not suit your needs.

Here is a simple implementation – It should convert the circle into a RevisionCloud circle. Of course, you can tweak it to your own needs.

AutoCAD version

From memory ed.Command() was introduced in the later AutoCAD versions, from 2015 onwards. If you want to use it for prior versions you might have to P/Invoke and make an unmanaged call. If you really require it then post a comment and I’ll see if I can dig up an answer.

Written on August 7, 2017