.NET

.NET

Reply
Valued Contributor
CommCorp
Posts: 97
Registered: ‎03-19-2007
Message 1 of 3 (225 Views)
Accepted Solution

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

225 Views, 2 Replies
11-06-2012 07:54 AM

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!)

Member
HolgerR
Posts: 3
Registered: ‎02-10-2010
Message 2 of 3 (219 Views)

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

11-06-2012 08:28 AM in reply to: CommCorp

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

Valued Contributor
CommCorp
Posts: 97
Registered: ‎03-19-2007
Message 3 of 3 (210 Views)

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

11-06-2012 09:20 AM 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

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.