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

Changing text height in text style command without opening the drawing?

5 REPLIES 5
Reply
Message 1 of 6
RedMan77
1097 Views, 5 Replies

Changing text height in text style command without opening the drawing?

I am still very new to .NET so I am asking for some assitance to see if its possible to change the height of the text within the STYLE command.  The issue is a mechanical/plumbing firm we are working with uses CAD-DUCT.  We have to change the text style height to 2-1/2" for it to be even visible when we Xref their mechanical or plumbing or med-gas drawings into our electrical drawing.  Since we up date our drawings from all the other disciplines we have to go throug this process everyday maually, each, one by one.  Its an extremely labor intensive process.  First is this even possible to do so without opening the drawing.  Second are thier routines like that out there avaialble?  Any help would be appreciated.  Thanks.

5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: RedMan77

I am not sure if your asking can change the text height of all the inserted text by changing the textstyle height, or mimic the the syle command?

 

This is a simple example that will Change the TextStyle Height

 

 [CommandMethod("ChangeTextSize")]
        public static void ChangeTextSize()
        {
            Database db = HostApplicationServices.WorkingDatabase;
            using (Transaction trx = db.TransactionManager.StartTransaction())
            {
                try
                {
                    TextStyleTable txtStyTbl = db.TextStyleTableId.GetObject(OpenMode.ForRead) as TextStyleTable;
                    if (txtStyTbl.Has("TestText"))
                    {
                        TextStyleTableRecord txtStyTblRec = txtStyTbl["TestText"].GetObject(OpenMode.ForWrite) as TextStyleTableRecord;
                        txtStyTblRec.TextSize = 2.5;                     
                    }
                }
                catch (System.Exception ex)
                {                    
                    System.Windows.Forms.MessageBox.Show(ex.Message);
                }
                trx.Commit();
            }
        }

 

 You could modify it to change closed drawings

 

Message 3 of 6
Hallex
in reply to: RedMan77

Take a look at this example

http://through-the-interface.typepad.com/through_the_interface/2007/07/updating-a-sp-1.html

You can go the same way for batch changing the height of  text style

(use Jeff_H's routine for example, say convert it to function before)

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 4 of 6
Anonymous
in reply to: Hallex

Take a look at Tony T's reply in the link Hallex provided.

I got a good laugh.

Message 5 of 6
Hallex
in reply to: Anonymous

Sorry, I don't like off-top in here, but what I can say

I respect him, despite all his prickles, but this is his personal opinion
I have created 2 quite the equipment design for my friends,
based on this example, these projects work without problems in А2008-2009,

as they said me about


FYI,

 

Regards,

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 6 of 6
RedMan77
in reply to: Anonymous

Cool! Modifying a selected folder of (closed drawings) is what I am ultimately after.  Some of the code makes sense and this definately gives me something to work with.  Thanks.  I appreciate the push.

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