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

Having a problem adding mvblocks to an open but NOT active drawing

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
jshimkus
533 Views, 2 Replies

Having a problem adding mvblocks to an open but NOT active drawing

I have written a program that basically replaces certain mvblocks, tags actually, in several drawings, the purpose being to change the displayed label of an object.

 

I have just 2 of the 3 affected drawings open and just 1 of those 2 is acually active at the time the program runs.

 

When I run the program the tags in the open and active drawing get replaced fine.

 

The tags in the open but NOT active drawing appear unchanged but a "regen" causes them to go away but the new tags do not appear, if I save, close, and reopen the drawing, as the drawing is reopening I see the new tags but the label text is offset and just prior to the drawing being fully open (back at "command" prompt) the tag text does move to its correct location. a save now saves the drawing correctly so on subsequent openings everthing is correct.

 

The tags in the unopened drawing, when I do open it, once again, I see the new tags but the label text is offset and just prior to the drawing being fully open (back at "command" prompt) the tag text does move to its correct location. a save now saves the drawing correctly so on subsequent openings everthing is correct.

 

Regardless of the state (open, unopen, active, inactive) I am running each drawing through the same subroutines to delete the old tag and put on the new as I am passing the drawing DB to the subroutines, the only difference being that I am putting a documentlock on the open drawings documents before I start the subroutines.

 

I do have the CommandFlags.Session flag set on the command that launches the progam. 

 

So, what am i missing that the new tags are not showing up in the open but inactive dwg intill the drawing is saved and reopened, and then in both, open and inactive and the unopened dwg the label text appears offset until the dwg opens completely?

 

(sorry for the long post but, trust me, its shorter than my code!)

2 REPLIES 2
Message 2 of 3
HolgerR
in reply to: jshimkus

Hi,

 

I'm not sure that I understand your issue well enough, but I solved a similar problem with calling the UpdateReferencingAttributes on the connected PropertySet.

 

best

Holger

Message 3 of 3
jshimkus
in reply to: HolgerR

Looks like you understood well enough.

I tried your suggestion and it correctly updates the tag text in all the drawings.

I will just need to change my approach so i just update the existing tag instead of replacing.

 

Thank you

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