Jump to content

Change text font in existing table


EdCycler

Recommended Posts

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

  • EdCycler

    20

  • tmreyes

    10

  • chelsea1307

    6

  • gmiani

    5

Top Posters In This Topic

Posted Images

Ed - sorry to hear you're still having trouble.

 

In an effort to debug this situation (thats working perfectly for me) and to help others out, I just want to run through you're setup to make sure we're on the same page.

 

Are you datalinking this table and/or using "paste special - autocad entities"? Or doing the "paste special - excel" deal (which will create a different result)?

 

Is your *.fmp file is showing up as an autocad icon? Meaning...it actually got changed from a notepad *.txt to a *.fmp extension.

 

Have you double checked your "options" setting to make sure its directed to that font map file.

Link to comment
Share on other sites

Are you datalinking this table and/or using "paste special - autocad entities"? Or doing the "paste special - excel" deal (which will create a different result)?

paste special - autocad entities

 

Is your *.fmp file is showing up as an autocad icon? Meaning...it actually got changed from a notepad *.txt to a *.fmp extension.

My *.fmp file is showing up as an autocad icon

 

Have you double checked your "options" setting to make sure its directed to that font map file.

C:\Program Files\Autodesk\Acade 2009\Acade\acad.fmp

Link to comment
Share on other sites

  • 2 months later...

I am having trouble editing my table text in properties. We just changed to windows 2007 and this is when the issues came about. before the change i had no trouble changing the font of all cells, now i have to go into each individual cell to change the font. i can pretty much change everything else in properties except the font. And it only does this with table I bring from excel, I'm doing everything as usual but now we can't change the font with out having to go into each cell and changing it.

 

i have tried going into the acad.fmp and doing the

"orig. font; new font " thing but its not working.

 

can someone plz help i have wasted days trying to figure this out.

Link to comment
Share on other sites

This is exactly the problem I was having. I solved it using the VBA macro I found. I still use the VBA macro. See the comment above for the VBA macro. I think it is comment #18.

 

Ed

Link to comment
Share on other sites

ok i must be doing something wrong, i press F5 to run it and there is an error

 

"Compile error:

User-defined type not defined"

 

and highlights "AcadApp As AutoCAD.AcadApplication'

 

Am i doing something wrong? or do i need to put something else.

Link to comment
Share on other sites

i was able to fix the macro but I am still having the same problem with not being able to change the table font in properties.

 

I was also able to change the acad.fmp file and it helps but i still need to be able to change font with out having to do it the long, and tedious way.

 

Anymore ideas?

 

I do appreciate the help!

 

FYI, i have autocad 2008 if that helps any.

Link to comment
Share on other sites

Technically, you do not change the table font, you change the table style. The macro removes all the hard-coded fonts attached by Excel. Type TABLESTYLE and change the font of the style of the table.

Link to comment
Share on other sites

Yes I meant text style not font. I have made sure my styles are correct and my table styles are correct. and I still cannot change the text style in properties.

 

I need to be able to change multiple cells at one time and now I can't anymore (through properties).

Link to comment
Share on other sites

Let me step through what I do to change the font properties in an imported Excel spreadsheet:

-Open Excel and copy the cells

-open AutoCAD and paste special - autocad entities

-check that the AutoCAD table text font in one cell is Calibri

-Load project and run the FixTableText macro.

-I get a Msg Box that says "All Table Text Fixed!"

-check that the AutoCAD table text font in one cell is romans, or something

-select several cells in the AutoCAD table

-go to properties, select Text Style, and select another style

Link to comment
Share on other sites

It worked thank you! :-)

 

I was running the macro in excel instead of autocad! oops

I did it slightly different though. i created the macro in autocad and ran it. the load project i dont know how to get that, meaning i dont know what file to pick or look for. am i missing a step? how do i create a *.dvb file that its looking for in the open VBA project window (that i get when clicking load project)?

 

FYI, im not very proficient in macros/VBE/VBA etc.

Link to comment
Share on other sites

ok i thought i figured it out with the VBA Manager, ACADProject.

 

I went into VBA manager

Clicked new (gives me ACADProject, GlobalX)

Click ACADProject, GlobalX

Then click Macros

Created a macro

Ran macro

closed and returned to autocad

clicked on ACADProject, GlobalX again

clicked save as, named it

i also saved that drawing

 

I then open i new drawing so i can load project and it doesnt have the macro

 

What am i doing wrong, or am i misunderstanding how VBA manager/projects/*.dvb files work?

Link to comment
Share on other sites

I will not be back in the office until Monday and so I do not have AutoCAD available to advise you.

 

I do remember that you have to save the macro separate from AutoCAD because you have to reload it each time you start AutoCAD.

Link to comment
Share on other sites

ok so what i did was save a template wit the macro, and when ever i have that drawing open all more drawings will have the macro available to them.

 

but i an issue came up. I work with cable and conduit schedules, and i have a column that has the conductors listed for each conduit.

 

now i can have "10X #14 AWG XHHW; 1X #12 AWG XHHW G" listed in the cell and it will take out the first half when i run the macro and only end up with "1X #12 AWG XHHW G".

 

Do you know whats going on with this. It seems like the semicolon is making it go away some how. cuz we can take out all the semicolons and replace it with a regular colon and run the macro and it works fine.

 

Can this be a simple fix, like editing the macro?

Link to comment
Share on other sites

Excel puts a semicolon into the cell.

example: {\fCalibri|b0|i0|c0|p34;\C7;yourtext}

 

The macro looks for the last semicolon in that whole expression and deletes from that point forward. You could add some code that changed that, like:

 

Locate

PPos = InStrRev(Celltext, ";")

 

Change To

PPos = InStrRev(Celltext, ";",25)

 

,25 sets the starting position for each search at 25 characters. You might want to vary this some depending on how long your text is.

Link to comment
Share on other sites

thank you that worked. now to make sure I understand it will delete anything after 25 characters (to the left of the semicolon)?

 

Is it significant to have either one of those codes in the macro?

Link to comment
Share on other sites

It will start looking for the semicolon after 25 characters from the right. It will delete from the semicolon. The 25 was only a guess on my part and can be any number that works.

Link to comment
Share on other sites

Every line of code is there for a reason. Take out the line and it will probably effect something. For example, if you remove:

PPos = InStrRev(Celltext, ";")

then the variable PPos will not be set by InStrRev(Celltext, ";") and will remain zero instead of some value and the complete cell text might be removed.

:(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...