Author Topic: Custom drawing scales  (Read 1354 times)

0 Members and 1 Guest are viewing this topic.

mwrtheswamp

  • Guest
Custom drawing scales
« on: July 24, 2013, 07:55:52 AM »
I've written an application to reset drawing scales to what our different disciplines want (which is not what Autodesk provides). I have no problem creating and adding the scales but can't reorder them.

The scales currently in use in the drawing appear at the bottom of the list, then the scales I've added appear at the top (and thus possibly out of order). Is there a way to insert the scale in the correct location in the scale list?

Dim occ As ObjectContextCollection = ocm.GetContextCollection("ACDB_ANNOTATIONSCALES")

I loop through the list of desired scales adding each as follows: (name and scale setting will differ)
Dim asc As New AnnotationScale()
asc.Name = "1in = 2 miles"
asc.PaperUnits = 1
asc.DrawingUnits = 10560
If Not occ.HasContext(asc.Name) Then
    occ.AddContext(asc)
 End If

WILL HATCH

  • Bull Frog
  • Posts: 450
Re: Custom drawing scales
« Reply #1 on: July 24, 2013, 01:31:46 PM »
I think if you use DBOject.SwapIdWith you'll get the desired result