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

Updating drawing/database after modifying it.

5 REPLIES 5
Reply
Message 1 of 6
Ertqwa
722 Views, 5 Replies

Updating drawing/database after modifying it.

Hello Forum,

 

I have written a command that replaces the given annotative scale of all objects in a drawing, with another annotative scale. Works great, except I can't remove the replaced annotative scale (with SCALELISTEDIT - DELETE button), unless I save the drawing and then open it again.

 

An annotative scale that is in use, can't be deleted. But since I can delete it after reopening the drawing, I am sure it is not in use anymore.

 

Is there a way to "refresh" the drawing/database, without reopening it?

 

Thank you.

 

 

5 REPLIES 5
Message 2 of 6
Artvegas
in reply to: Ertqwa

Did you set the Database.Cannoscale property to one of your new scales? I would have thought you could then erase the unused scale.

 

Have you looked into any of the following posts? Numbers 3 and 4 might be helpful.

 

1. Adding a new annotation scale in AutoCAD using .NET:
http://through-the-interface.typepad.com/through_the_interface/2007/04/adding_a_new_an.html

2. Making AutoCAD objects annotative using .NET:
http://through-the-interface.typepad.com/through_the_interface/2007/04/making_autocad_.html

3. Deleting unused annotation scales in AutoCAD using .NET:
http://through-the-interface.typepad.com/through_the_interface/2008/05/deleting-unused.html

4. Delete "all but current" Annotation Scales on AutoCAD objects using .NET:
http://through-the-interface.typepad.com/through_the_interface/2011/10/delete-all-but-current-annota...

5. Using the .NET API to add a scale to a drawing:
http://adndevblog.typepad.com/autocad/2012/05/using-the-net-api-to-add-a-scale-to-a-drawing.html

6. Annotation scale being used in Model Space:
http://adndevblog.typepad.com/autocad/2012/05/annotation-scale-being-used-in-model-space.html

 

Art

Message 3 of 6
Ertqwa
in reply to: Artvegas

Hi,

 

yes I am not trying to delete the current annotation scale.

 

I've looked at the links (very interesting ty), but haven't found anything yet to solve my problem. I've litterally copied the command from article 3 (Deleting unused annotation scales), and the same problem happens.

- I replace old scale with new scale.

- Command from article 3 can not remove old scale.

- Save and reopen.

- Command from article 3 can remove old scale.

 

This does not happen with all drawings and/or annotative scales. Some can be removed without saving and reopening.

 

Thank you for your response.

Message 4 of 6
Artvegas
in reply to: Ertqwa

I'm not sure how you could refresh the database without programatically closing and reopening the drawing. If you post a sample drawing and code I'd be happy to take a closer look. Art
Message 5 of 6
Ertqwa
in reply to: Artvegas

Hi,

 

try the following to simulate my problem:

 

Start a new drawing with annoscales: 1:1/1:2/1:4.

Remove everything from the layouts.

Goto modelspace.
Set annoscale to 1:2.
Draw a rectangle.
Fill rectangle with annotative hatch (1:2).
Create a NON-ANNOTATIVE block from the rectangle+hatch called test.

Set the current annotative scale to 1:4 (IMPORTANT).

Save and reopen the drawing. Now change the current annotative scale
to 1:1. The scale 1:4 is no longer in use by anything, so you should
be able to delete it, but you can't. At least, I can't (on 2 different systems with AutoCAD2009).

But If I set the current annotative scale to 1:1, save and reopen, I
suddenly can remove the 1:4...


Message 6 of 6
Artvegas
in reply to: Ertqwa

I see what you mean. This appears to me to be an internal AutoCAD issue (perhaps even a bug) rather than an issue with the .NET API. Sorry I can't think of anything to help you with this one.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost