Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Insert Block missing until drawing closed and re-opened

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
864 Views, 4 Replies

Insert Block missing until drawing closed and re-opened

The vast majority of my blocks insert correctly using my c# code however I'm having some issues with a couple of them.

 

I have attached some images to show the issue, some of the blocks won't appear at all until the drawing is closed and opened again, for others only part of the block will appear.

 

Zoom extents doesn't recognize the non visible blocks, however they are properly defined in the drawing and if I use the insert command and select them it will place the correct block in the drawing.

 

Any help would be appreciated.

 

Thanks,

Tags (1)
4 REPLIES 4
Message 2 of 5
Virupaksha_aithal
in reply to: Anonymous

Hi,

 

try calling regen or regen3 command at the end of your code and see if regenerating the display list resolves your issue?



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

Message 3 of 5
Anonymous
in reply to: Virupaksha_aithal

Thanks for the reply, neither of these work but I did notice that upon further investigation all the blocks causing issues are annotative.  For the one block this wasn't required so I changed it and now it inserts correctly, for the others I'm guessing they are either being defined wrong or inserted wrong.  It seems weird to me that once I close and open they appear though.

 

All the text elements correctly show up, it is just he non text elements that don't show until an open and close.  Should just the text elements of the block be annotative and not the whole block?  Sorry I'm more of a developer and don't have a ton of experience within AutoCAD itself other than development.

Message 4 of 5
Virupaksha_aithal
in reply to: Anonymous

Hi,

Please try the blog code http://adndevblog.typepad.com/autocad/2012/07/inserting-annotative-blocks.html and see if you can insert the blocks correctly.



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

Message 5 of 5
Anonymous
in reply to: Virupaksha_aithal

Thanks that seems to be the issue.  I was missing this part of the code for Annotative Blocks

 

acBlkTblRec.Annotative = AnnotativeStates.True;
ObjectContextManager ocm = database.ObjectContextManager;
ObjectContextCollection occ = ocm.GetContextCollection("ACDB_ANNOTATIONSCALES");
ObjectContexts.AddContext(acBlkRef, occ.CurrentContext);

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report