Add annotative scale via COM

Add annotative scale via COM

Anonymous
Not applicable
471 Views
2 Replies
Message 1 of 3

Add annotative scale via COM

Anonymous
Not applicable
I want to add an annotative scale (for example 1:20) to my dimension(s) in ModelSpace.

I have seen an example how to do this with ObjectARX by Kean Walmsley: "Making AutoCAD objects annotative using .NET"
(http://through-the-interface.typepad.com/through_the_interface/2007/04/making_autocad_.html)

But I want to do the exact same thing via .Net COM...

Any insight is highly appreciated!
0 Likes
472 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Why do you want to do it via COM?

Having asked that you may getter a better response by posting it as a VBA question in the relevant group and if you get a response there converting it to .NET.

Regards - Nathan
0 Likes
Message 3 of 3

Anonymous
Not applicable
Hi Nathan,

Why via COM? By using MS Excel, I have created a configurator which...

1) ...starts AutoCAD if it's not running...
2) ...starts a new drawing from a specific template
3) ...copies Dynamic Blocks from a library drawing to the new drawing
4) ...inserts those Dynamic Blocks in ModelSpace at specific coordinates
5) ...modifies the Dynamic Properties of those Dynamic Blocks (adjusting width and height)
6) ...adds dimensions (at scale 1:1) at the proper locations in ModelSpace
7) ...creates ViewPorts in PaperSpace, looking at the right positions in ModelSpace
8) ...adds Notes, Leaders, etc. to PaperSpace
9) ...changes the attributes of the Title Block
10) ...plots the drawing to PDF
11) ...saves the drawing as a DXF (or DWG) to the network

All is working, except for two things:

A) Adding an Annotative Scale

The scale of the 'main view' depends on the size of our construction (either the height or the width drives the scale of the 'main view'). For example, a small construction will result in a scale of 1:10, but larger construction will result in a scale of 1:20 (or 1:40 r 1:50, etc). The main dimensions which I show in that 'main view' must have the corresponding annotative scale.

With ObjectARX, I can add the annotative scale to my dimensions, but I want to automate AutoCAD from Excel.

If only I could 'access' the custom commands which the ObjectARX adds to AutoCAD...(but I don't know how)

B) Hatches

The hatching of my Dynamic Block is not correctly generated, and it refuses to update. I have tried (with code) Regen, Update, going into MSpace of the ViewPort and perform an update/regen...nothing happens! If I activate the ViewPort by hand and perform a regen...the hatch updates just fine. Go figure...

As for the VBA, I already had started topcic here: http://discussion.autodesk.com/forums/thread.jspa?threadID=724758

Thanks,

Teun
0 Likes