EdCycler Posted October 12, 2009 Posted October 12, 2009 I have an existing table that was imported from Excel and has a Calibri font. It is a large table. How can I change the font of all cells at the same time. I can only see how to do it one cell at a time. Ed Quote
chelsea1307 Posted October 12, 2009 Posted October 12, 2009 If you select all cells (so they have the yellow box around them) you can change the font type through properties Quote
EdCycler Posted October 12, 2009 Author Posted October 12, 2009 Tried that. Properties, Content, text style. The style changes but the text font in the table does not. Quote
chelsea1307 Posted October 12, 2009 Posted October 12, 2009 Have you tried changing the font type in xl to what you want it to be? Quote
EdCycler Posted October 12, 2009 Author Posted October 12, 2009 I do not have the original XL file. But,even if I did my customer requires 'Romans.shx' which is not supported by XL. Quote
chelsea1307 Posted October 12, 2009 Posted October 12, 2009 My excell has RomanS, thats my companies standard font, another thing you might face is issues with printing, i could not get romans to plot right when in a autocad table that was linked. I dont know why, if i typed it directly into the table it plotted fine but if it was linked to excel it plotted really light, only font with the problem Quote
EdCycler Posted October 12, 2009 Author Posted October 12, 2009 Thanks for your continued help. But I do not have the original XL file. Is there a way to export the Autocad table to XL? Then I could change the font and import it back to Autocad... Still somewhat arkward. Quote
chelsea1307 Posted October 12, 2009 Posted October 12, 2009 I believe there is a way gimmie one sec while i figure out how. Linking excel tables always seems a little bit backward to me Quote
chelsea1307 Posted October 12, 2009 Posted October 12, 2009 right click the table, click export save it to a location, it saves as a .csv but excel opened it on my comp Quote
EdCycler Posted October 12, 2009 Author Posted October 12, 2009 Thanks, that works. Not as smooth as I would have liked, but better than what I have now. Quote
EdCycler Posted October 13, 2009 Author Posted October 13, 2009 The font still seems to be locked. I am able to export the table to XL, change the font, and import to AutoCAD. Once in AutoCAD the font remains locked. I need to apply a non-true type font, so this process works, but not for me. Quote
chelsea1307 Posted October 13, 2009 Posted October 13, 2009 Im out of ideas, sorry. Post back if you find a solution or work around Quote
EdCycler Posted October 13, 2009 Author Posted October 13, 2009 I did a dxfout, search and replace of fCalibri and then dxfin. Arkward but it worked. Now I can control the table with styles. Example: old - {\fCalibri|b0|i0|c0;VOLTAGE DIRECT CURRENT new - VOLTAGE DIRECT CURRENT Quote
gmiani Posted October 22, 2009 Posted October 22, 2009 Alright...I think I've got a fix to this one...might not work for everyone in every situation and I haven't worked out all of the bugs/nuances. Autocad utilizes a font map to replace typically missing, errant, or similar-but-not-quite-right fonts with a font that it recognizes. This data is held in *.fmp file. PROCEDURE 1) Type command "options" or "op" for short 2) Look on your "files" tab, under "text editor..." and find "font mapping file" and note the locations (should be on under your docs and settings deep down in the Autodesk support data folder) and more than likely is called "acad.fmp" 3) Find and open that file (it should open in Notepad) 4) At the bottom of the string of data, enter your own font problem, syntax is key and it must appear in this form ORIG FONT; FONT TO CHANGE TO.xxx Updated by gmiani - this format is now correct Ex. Arial; Romans.shx Updated by gmiani - this format is now correct Note: Notice that the first font has no extension...only the second. 5) The cautious would save a copy of the original font map before altering the original...thats your choice. 6) Close your drawing (if you haven't already)....and reopen. Poof...text is changed. 7) If you have cell styles, you can apply them now and it will change all the other characteristics of the cell. I've been struggling with this very topic for a while now. I have a LARGE amount of data that needs to be placed from excel and put onto our ACAD set. But our client requires a particular size and style font. The formatting of our excel spreadsheet was too complex to simply link it without the formatting. But the problem arose with taking the "Arial" text of Excel and turn it into "Romans" as required. As others have found, establishing a cell style will change formatting only so far (text height, width factor, etc), but it would NOT change the font. This fix will automatically change the font as soon as you reopen the drawing. The drawback is that it will always change that text until you remove the font map edit as shown above. So in the future if you want that text to show up...it won't...until you remove it from the font map. This can only be applied on a drawing by drawing basis (not layout by layout). Quote
EdCycler Posted October 22, 2009 Author Posted October 22, 2009 It did not work for me. There was no file at the location, so I created an empty one and added Calibri, Romans.shx. Nothing happened. Ed Quote
gmiani Posted October 22, 2009 Posted October 22, 2009 Ed Well...after all my talk of syntax....I made a little mistake it seems. The format should have a semi-colon....not a comma. I will edit my original post. Hope that does the trick...and sorry for the initial misinformation. -gabe If you are still having issues...consider these points. 1) Under the "Font Mapping File" location (within the "Text editor,..." section, under the "files" tab, from the Options Window), there WAS NO file called out? I was almost positive that ACAD came with this file when installed. If not, its fine that you created a *.fmp...proceed to #2 below. 2) After you created the file (which as far as I can tell, what you put in is all you need...with the exception of the aforementioned syntax) did you remember to direct the "font mapping file" path to that file? 3) Double check your original font name...ensure that it is "calibri" verbatum. Quote
EdCycler Posted October 22, 2009 Author Posted October 22, 2009 Still does not work-- This is the path: Font Mapping File -->C:\Program Files\Autodesk\Acade 2009\Acade\ACAD.FMP This is my text: Calibri; Romans.shx I am using AutoCAD Electrical. Quote
EdCycler Posted October 22, 2009 Author Posted October 22, 2009 I like your idea, if it works because it is simple, but I found this VBA macro on the web by jhopeross (http://discussion.autodesk.com/forums/message.jspa?messageID=6123737) and it works OK. I modified his slightly: Public Sub FixTableText() On Error GoTo GetBOMTableItemsErr Dim FilterType(0) As Integer Dim FilterData(0) As Variant Dim SS1 As Object Dim ans As String Dim Celltext As String Dim CatalogNumber As String Dim TableRows As Integer Dim TableCols As Integer Dim PPos As Integer Dim CRow As Integer Dim CCol As Integer Dim CurTable As Object Dim I As Integer Dim AcadApp As AutoCAD.AcadApplication Dim ThisDrawing As AutoCAD.AcadDocument DoEvents Set AcadApp = AutoCAD.Application Set ThisDrawing = AcadApp.ActiveDocument ThisDrawing.Application.ZoomExtents DoEvents Set SS1 = ThisDrawing.SelectionSets.Item("SS1") If SS1 Is Nothing Then Set SS1 = ThisDrawing.SelectionSets.Add("SS1") Else SS1.Clear End If FilterType(0) = 0 FilterData(0) = "ACAD_TABLE" SS1.Select acSelectionSetAll, , , FilterType, FilterData If SS1.Count > 0 Then For Each CurTable In SS1 ' Process the Tables on this drawing TableRows = CurTable.Rows TableCols = CurTable.Columns For CRow = 0 To TableRows - 1 For CCol = 0 To TableCols - 1 Celltext = CurTable.GetCellValue(CRow, CCol) DoEvents If Celltext Like "{*;*" Then PPos = InStrRev(Celltext, ";") If PPos > 0 Then Celltext = Mid(Celltext, PPos + 1, Len(Celltext) - PPos) If Celltext Like "*}" Then Celltext = Left(Celltext, Len(Celltext) - 1) End If CurTable.SetCellValue CRow, CCol, Celltext I = I + 1 End If End If 'Debug.Print "CRow: " & CRow & " CCol: " & CCol & Celltext Next CCol Next CRow Next CurTable End If If Not SS1 Is Nothing Then SS1.Clear SS1.Delete Set SS1 = Nothing End If If I = 0 Then MsgBox "All Table Text Fixed!", vbInformation, "No Table Text Problems" Else MsgBox "All Table Text Fixed!", vbInformation, "Number of cells fixed " & I End If Exit Sub GetBOMTableItemsErr: If UCase$(Error) Like "*KEY NOT FOUND*" Then Resume Next Else MsgBox Error Resume Next End If End Sub Quote
gmiani Posted October 22, 2009 Posted October 22, 2009 REVISED by gmiani I all too quickly assumed that the font map depended on the font's FILE name...and not the font name. BUT IT IS THE OTHER WAY AROUND upon further testing. YOU MUST USE THE FONT NAME (not the file name for the font). Hmmm...interesting. One more check for you. Calibri, which i assume is a true type (ttf), you must keep in mind that each type of calibri (i.e. bold, italic, narrow, etc) will have an slightly different font name. For example, Arial comes in bold, narrow, italic. So the correct nomenclature for the font map would be Arial; romans.shx or Arial Narrow;romans.shx Each type that you use in your excel will need to be addressed in the font map. And again...it has to appear exactly as the FONT name...not the file name. If you already did this...then we're back to the drawing board. Also, when you access a cell in your linked table, then select the text for editting, it brings up the text dialog box...does this say that it is using "Calibri"? Quote
Recommended Posts
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.