Author Topic: "tblnext" shows no group 3 for Textstyle  (Read 9400 times)

0 Members and 1 Guest are viewing this topic.

Peter2

  • Swamp Rat
  • Posts: 650
"tblnext" shows no group 3 for Textstyle
« on: October 30, 2014, 06:09:34 PM »
I have some drawings with a textstyle named "Arial". Starting the dialogue "Style" that it uses "Arial Bold TTF".

But working with "tblnext" and "tblsearch" shows no entry for DXF-Group 3 (fontname). I tried with _purge, _audit, _regen, _-style (which shows Arial Bold too) .... - nothing changed, see following log. The problem is that now an analysis of the drawing shows "empty textfont" which is wrong - or not wrong??

Any ideas how to get the correct DXF-value?

Code - Auto/Visual Lisp: [Select]
  1. Autodesk-DWG. Diese Datei ist eine zuverlässige DWG-Datei, die zuletzt von einer Autodesk-Anwendung bzw. einer von Autodesk lizenzierten Anwendung gespeichert wurde.
  2.  
  3. Befehl:
  4. Befehl: (tblnext "style" t)
  5. ((0 . "STYLE") (2 . "STANDARD") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 4.0) (3 . "romans.shx") (4 . ""))
  6.  
  7. Befehl: (tblnext "style")
  8. ((0 . "STYLE") (2 . "ROMANS") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 2.5) (3 . "romans.shx") (4 . ""))
  9.  
  10. Befehl: (tblnext "style")
  11. ((0 . "STYLE") (2 . "BEAU") (70 . 0) (40 . 0.0) (41 . 1.0) (50 . 0.0) (71 . 0) (42 . 2.5) (3 . "romand.shx") (4 . ""))
  12.  
  13. Befehl: (tblnext "style")
  14. ((0 . "STYLE") (2 . "Arial") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 2.0) (3 . "") (4 . ""))
  15.  
  16. Befehl: (tblnext "style")
  17. ((0 . "STYLE") (2 . "Simplex") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 2.5) (3 . "simplex.shx") (4 . ""))
  18.  
  19. Befehl: (tblnext "style")
  20. ((0 . "STYLE") (2 . "ROMAND") (70 . 0) (40 . 0.0) (41 . 1.0) (50 . 0.0) (71 . 0) (42 . 13.0) (3 . "romand") (4 . ""))
  21.  
  22. Befehl: (tblnext "style")
  23. nil
  24.  
  25. Befehl: _PURGE
  26.  
  27. Befehl: (tblnext "style" t)
  28. ((0 . "STYLE") (2 . "STANDARD") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 4.0) (3 . "romans.shx") (4 . ""))
  29.  
  30. Befehl: (tblnext "style")
  31. ((0 . "STYLE") (2 . "Arial") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 2.0) (3 . "") (4 . ""))
  32.  
  33. Befehl: _AUDIT
  34.  
  35. Gefundene Fehler beheben? [Ja/Nein] <N>: n
  36.  
  37. Prüft Header
  38. Prüft Tabellen
  39. Prüft Objekte Durchgang 1
  40. Durchgang 1 400     Objekte geprüft
  41. Prüft Objekte Durchgang 2
  42. Durchgang 2 400     Objekte geprüft
  43. Prüft Blöcke
  44.  3       Blöcke geprüft
  45. AcDsRecords wird überprüft
  46.  
  47. 0 Fehler gefunden, 0 behoben
  48. 0 Objekte gelöscht
  49.  
  50. Befehl: (tblnext "style" t)
  51. ((0 . "STYLE") (2 . "STANDARD") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 4.0) (3 . "romans.shx") (4 . ""))
  52.  
  53. Befehl: (tblnext "style")
  54. ((0 . "STYLE") (2 . "Arial") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 2.0) (3 . "") (4 . ""))
  55.  
  56. Befehl: RG
  57. REGEN Regeneriert Modell.
  58.  
  59. Befehl: (tblnext "style" t)
  60. ((0 . "STYLE") (2 . "STANDARD") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 4.0) (3 . "romans.shx") (4 . ""))
  61.  
  62. Befehl: (tblnext "style")
  63. ((0 . "STYLE") (2 . "Arial") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 2.0) (3 . "") (4 . ""))
  64.  
  65. Befehl: _AUDIT
  66.  
  67. Gefundene Fehler beheben? [Ja/Nein] <N>: _yes
  68.  
  69. Prüft Header
  70. Prüft Tabellen
  71. Prüft Objekte Durchgang 1
  72. Durchgang 1 400     Objekte geprüft
  73. Prüft Objekte Durchgang 2
  74. Durchgang 2 400     Objekte geprüft
  75. Prüft Blöcke
  76.  3       Blöcke geprüft
  77.  
  78. AcDsRecords wird überprüft
  79.  
  80. 0 Fehler gefunden, 0 behoben
  81. 0 Objekte gelöscht
  82.  
  83. Befehl: (tblnext "style" t)
  84. ((0 . "STYLE") (2 . "STANDARD") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 4.0) (3 . "romans.shx") (4 . ""))
  85.  
  86. Befehl: (tblnext "style")
  87. ((0 . "STYLE") (2 . "Arial") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 2.0) (3 . "") (4 . ""))
  88.  
  89. Befehl: _-STYLE
  90. Namen des Textstils eingeben oder [?] <STANDARD>: arial
  91.  
  92. Aktueller Textstil. Vollständiger Name der Schriftdatei = Arial Fett
  93. Vollständigen Namen der Schrift oder der Schriftdatei angeben (TTF oder SHX) <txt>: *Abbruch*
  94.  
  95. Befehl: (tblnext "style" t)
  96. ((0 . "STYLE") (2 . "STANDARD") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 4.0) (3 . "romans.shx") (4 . ""))
  97.  
  98. Befehl: (tblnext "style")
  99. ((0 . "STYLE") (2 . "Arial") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 2.0) (3 . "") (4 . ""))
  100.  
  101. Befehl: _STYLE
  102.  
  103. Befehl: (tblnext "style" t)
  104. ((0 . "STYLE") (2 . "STANDARD") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 4.0) (3 . "romans.shx") (4 . ""))
  105.  
  106. Befehl: (tblnext "style")
  107. ((0 . "STYLE") (2 . "Arial") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 2.0) (3 . "") (4 . ""))
  108.  
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

hermanm

  • Guest
Re: "tblnext" shows no group 3 for Textstyle
« Reply #1 on: October 30, 2014, 09:34:37 PM »
Peter -

no clue.:(

Here is what I get on an open dwg:

Quote
Command: (tblnext "style")
((0 . "STYLE") (2 . "STANDARD") (70 . 0) (40 . 0.0) (41 . 0.8 ) (50 . 0.0) (71 . 0) (42 . 6.0) (3 . "simplex.shx") (4 . ""))

Command: (tblnext "style")
((0 . "STYLE") (2 . "SSDCP") (70 . 0) (40 . 0.0) (41 . 0.75) (50 . 0.0) (71 . 0) (42 . 1.5) (3 . "SIMPLEX.shx") (4 . "spec.shx"))

Command: (tblnext "style")
((0 . "STYLE") (2 . "STYLE2") (70 . 0) (40 . 0.09375) (41 . 0.8 ) (50 . 0.0) (71 . 0) (42 . 0.09375) (3 . "lucon.TTF") (4 . ""))

Command: (tblnext "style")
((0 . "STYLE") (2 . "STYLE3") (70 . 0) (40 . 0.0) (41 . 0.8 ) (50 . 0.0) (71 . 0) (42 . 6.0) (3 . "romant.shx") (4 . "SPEC.shx"))

Command: (tblnext "style")
((0 . "STYLE") (2 . "ROMAND") (70 . 0) (40 . 0.0) (41 . 1.0) (50 . 0.0) (71 . 0) (42 . 0.125) (3 . "ROMAND.SHX") (4 . "tcs_nbar.shx"))

Command: (tblnext "style")
((0 . "STYLE") (2 . "S80") (70 . 0) (40 . 0.0) (41 . 0.8 ) (50 . 0.0) (71 . 0) (42 . 0.125) (3 . "romans5.shx") (4 . "TCS_SPEC.shx"))

Command: (tblnext "style")
((0 . "STYLE") (2 . "RD90O10") (70 . 0) (40 . 0.0) (41 . 0.9) (50 . 0.174533) (71 . 0) (42 . 0.125) (3 . "ROMAND.SHX") (4 . "tcs_spec.shx"))

Command: (tblnext "style")
((0 . "STYLE") (2 . "TB-Title") (70 . 0) (40 . 0.0) (41 . 0.9) (50 . 0.0) (71 . 0) (42 . 0.125) (3 . "ARIALUNI.TTF") (4 . ""))

Command: (tblnext "style")
((0 . "STYLE") (2 . "S80BAR") (70 . 0) (40 . 0.0) (41 . 0.8 ) (50 . 0.0) (71 . 0) (42 . 1.0) (3 . "romans5.shx") (4 . "TCS_BAR.shx"))

Command: (tblnext "style")
((0 . "STYLE") (2 . "S80NBAR") (70 . 0) (40 . 0.0) (41 . 0.8 ) (50 . 0.0) (71 . 0) (42 . 0.125) (3 . "romans5.shx") (4 . "tcs_nbar.shx"))

Command: (tblnext "style")
((0 . "STYLE") (2 . "Annotative") (70 . 0) (40 . 0.0) (41 . 1.0) (50 . 0.0) (71 . 0) (42 . 0.2) (3 . "txt") (4 . ""))

Command: (tblnext "style")
nil

The TTF styles do show a GC 3

???

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: "tblnext" shows no group 3 for Textstyle
« Reply #2 on: October 31, 2014, 03:27:35 AM »
On AutoCAD 2014:
I don't have an Arial Bold.TTF

I have an Arial.TTF which I use with FontStyle 'Bold" for my Style 'BOLD'
DXF 3 value is arialdb.ttf

I made a Style 'Arial' with Arial.TTF with FontStyle 'Regular"
DXF 3 value is arial.ttf


Command: (tblnext "style")
((0 . "STYLE") (2 . "BOLD") (70 . 0) (40 . 0.0) (41 . 1.0) (50 . 0.0) (71 . 0) (42 . 90.0) (3 . "arialbd.ttf") (4 . ""))
Command: (tblnext "style")
((0 . "STYLE") (2 . "Arial") (70 . 0) (40 . 35.0) (41 . 1.0) (50 . 0.0) (71 . 0) (42 . 35.0) (3 . "arial.ttf") (4 . ""))

« Last Edit: October 31, 2014, 04:29:36 AM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Peter2

  • Swamp Rat
  • Posts: 650
Re: "tblnext" shows no group 3 for Textstyle
« Reply #3 on: October 31, 2014, 05:35:24 AM »
Hi

thanks for the answers. It is a strange issue of "refresh" the database. I tried to reduce the drawing to the minimum and than I made I "save as - DWG" which "refreshed the value.

I tried also a "save as - DXF", and the DXF has also missing value for code  3.

Just now I see there are additional codes 1000 and 1071, and 1071 is defined as
Quote
1071
A long value which contains a truetype font’s pitch and family, charset, and italic and bold flags

Maybe the solution is:
Code - Auto/Visual Lisp: [Select]
  1. "If 3 is empty, then check 1000"??

Code - Auto/Visual Lisp: [Select]
  1. AcDbSymbolTableRecord
  2. 100
  3. AcDbTextStyleTableRecord
  4.   2
  5. BEAU       <<-- Here begins the style with name "Beau"
  6.  70
  7.      0
  8.  40
  9. 0.0
  10.  41
  11. 1.0
  12.  50
  13. 0.0
  14.  71
  15.      0
  16.  42
  17. 3.5
  18.   3
  19. ROMAND.shx       <<-- Here is a correct value of code 3
  20.   4
  21.  
  22.   0
  23. STYLE
  24.   5
  25. 10C3
  26. 330
  27. 3
  28. 100
  29. AcDbSymbolTableRecord
  30. 100
  31. AcDbTextStyleTableRecord
  32.   2
  33. Arial       <<-- Here begins the style with name "Arial"
  34.  70
  35.      0
  36.  40
  37. 0.0
  38.  41
  39. 0.8
  40.  50
  41. 0.0
  42.  71
  43.      0
  44.  42
  45. 2.5
  46.   3
  47.       <<-- Here is the empty code 3
  48.   4
  49.  
  50. 1001
  51. ACAD
  52. 1000
  53. Arial
  54. 1071
  55.  33554466
  56.   0
  57. STYLE
  58.   5
  59. 1239
  60. 330
  61. 3
  62. 100
  63. AcDbSymbolTableRecord
  64. 100
  65. AcDbTextStyleTableRecord
  66.   2
  67. Simplex
  68.  70
  69.      0
  70.  40
  71. 0.0
  72.  41
  73. 0.8
  74.  50
  75. 0.0
  76.  71
  77.      0
  78.  42
  79. 2.5
  80.   3
  81. simplex.shx
  82.   4
  83.  
  84.   0
  85. ENDTAB
  86.   0
  87. TABLE
  88.   2
  89. VIEW
  90.   5
  91. 6
  92. 330
  93. 0
  94. 100
  95. AcDbSymbolTable
  96.  70
  97.      0
  98.   0
  99. ENDTAB
  100.   0
  101. TABLE
  102.   2
  103. UCS
  104.   5
  105. 7
  106. 330
  107. 0
  108.  
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: "tblnext" shows no group 3 for Textstyle
« Reply #4 on: October 31, 2014, 05:50:03 AM »
Peter,
Can you please post the drawing you are checking.

Can you generate text using the style ?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Peter2

  • Swamp Rat
  • Posts: 650
Re: "tblnext" shows no group 3 for Textstyle
« Reply #5 on: October 31, 2014, 06:36:33 AM »
Hi Kerry

...Can you please post the drawing you are checking....
Yes, I would like to, but it is a drawing of a client.

...Can you generate text using the style ?
Yes, no problem.

Maybe there is really a relation between codes 3 - 1000 - 1071.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: "tblnext" shows no group 3 for Textstyle
« Reply #6 on: October 31, 2014, 10:24:47 AM »
Two questions:
1. Do you have the .tff file on your system?
2. Have you tried vla-get-fontfile?


Peter2

  • Swamp Rat
  • Posts: 650
Re: "tblnext" shows no group 3 for Textstyle
« Reply #7 on: October 31, 2014, 10:31:20 AM »
..1. Do you have the .tff file on your system?...
Yes. But I don't think that the (non-)existence of a font should have an effect of GC 3.

...2. Have you tried vla-get-fontfile?
No. But I will try later and report here.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: "tblnext" shows no group 3 for Textstyle
« Reply #8 on: October 31, 2014, 05:36:22 PM »
...Can you please post the drawing you are checking....
Yes, I would like to, but it is a drawing of a client.

Have you considered removing the  proprietary content ?

Was the drawing originated by you or by the client. ( may be a hint as to the cause of the issue )


Maybe there is really a relation between codes 3 - 1000 - 1071.

Do yo have any reason to believe that ?
Have you checked the meaning of the 1000 and 1071 keys ?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Peter2

  • Swamp Rat
  • Posts: 650
Re: "tblnext" shows no group 3 for Textstyle
« Reply #9 on: November 01, 2014, 05:11:30 AM »
...Have you considered removing the  proprietary content ?...
Yes, I tried. But these operations created a "refresh" of the database and a correct entry of GC 3.

And, my problem is not to modify and to refresh the data, my problem is that I have to analyse a lot of drawings which can not be modified.

...Was the drawing originated by you or by the client. ( may be a hint as to the cause of the issue )...
They are made by the client.

Do yo have any reason to believe that ?
Have you checked the meaning of the 1000 and 1071 keys ?
The DXF-fragment I posted above has a GC (1000 . Arial), and GC 1071 contains flags  related to the TTF (see citation of Online help above)
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: "tblnext" shows no group 3 for Textstyle
« Reply #10 on: November 01, 2014, 04:24:01 PM »
I assume the portion of the dump you are referring to is:
1001
ACAD
1000
Arial
1071
 33554466
  0
STYLE
  5
1239
330
3


I thought this was depicting extended data ??

This data is not included in the TableSearch data you show.

//====================

Quote
Yes, I tried. But these operations created a "refresh" of the database and a correct entry of GC 3.
I can't visualise this.
Are you saying that deleting all the graphical elements in the drawing correct the issue you have ?


//====================
added:
Peter,
What is the actual font name defined in the Style Dialog ??
« Last Edit: November 01, 2014, 04:45:55 PM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: "tblnext" shows no group 3 for Textstyle
« Reply #11 on: November 01, 2014, 05:39:51 PM »
Have you tried inspecting the xdata for the STYLE (AcDbTextStyleTableRecord) entity?

e.g.:
Code: [Select]
(entget (tblobjname "style" "standard") '("*"))

Peter2

  • Swamp Rat
  • Posts: 650
Re: "tblnext" shows no group 3 for Textstyle
« Reply #12 on: November 01, 2014, 06:26:38 PM »
I assume the portion of the dump you are referring to is:
1001
ACAD
1000
Arial
1071
 33554466
  0
STYLE
  5
1239
330
3

Yes.
...I thought this was depicting extended data ??

This data is not included in the TableSearch data you show.
...
Extended data:
I don't know - maybe the "newer" versions of AutoCAD uses these codes besides of / additional to Xdata?
The DXF-code for Acad 14 does not mention these codes:
http://www.autodesk.com/techpubs/autocad/acadr14/dxf/index.htm

DXF-Code for AutoCAD 2013 mention code 1071:
http://docs.autodesk.com/ACD/2013/ENU/index.html?url=files/GUID-EF68AF7C-13EF-45A1-8175-ED6CE66C8FC9.htm,topicNumber=d30e676946

Tablesearch:
Yes. I showed the results that AutoCAD gave to me. I found GC 1000 and 1071 only in DXF-file.

I can't visualise this.
Are you saying that deleting all the graphical elements in the drawing correct the issue you have ?...
Not exactly. I tried to create a file which could be posted here, and while removing the most graphical elements (except two ATTDEFs) and saving and reopening the fille corrected the problem.

...What is the actual font name defined in the Style Dialog ??
The Style-dialogue has no problem with it - it shows Font "(TT) Arial", set to "Bold".

Have you tried inspecting the xdata for the STYLE (AcDbTextStyleTableRecord) entity?..
Not until your advice:

Code - Auto/Visual Lisp: [Select]
  1. Befehl: (entget (tblobjname "style" "standard") '("*"))
  2. ((-1 . <Objektname: 7ffffb32900>) (0 . "STYLE") (330 . <Objektname: 7ffffb32830>) (5 . "10") (100 . "AcDbSymbolTableRecord") (100 . "AcDbTextStyleTableRecord") (2 . "STANDARD") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 2.5) (3 . "romans.shx") (4 . ""))
  3.  
  4. Befehl: (entget (tblobjname "style" "arial") '("*"))
  5. ((-1 . <Objektname: 7ffffb23550>) (0 . "STYLE") (330 . <Objektname: 7ffffb32830>) (5 . "1D5") (100 . "AcDbSymbolTableRecord") (100 . "AcDbTextStyleTableRecord") (2 . "Arial") (70 . 0) (40 . 0.0) (41 . 0.8) (50 . 0.0) (71 . 0) (42 . 2.0) (3 . "") (4 . "") (-3 ("ACAD" (1000 . "Arial") (1071 . 33554466))))
  6.  
So it seem to be really  hidden in Xdata.


Added: Some links
Question in Autodesk Forum 2007/2008/2009, but no answer:
http://forums.autodesk.com/t5/autocad-2007-2008-2009/gr1071-extended-data-in-style-table/td-p/1685113
Nearly the same, and linked to the URL above:
http://qcad.org/bugtracker/index.php?do=details&task_id=203
« Last Edit: November 01, 2014, 06:48:50 PM by Peter2 »
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

Peter2

  • Swamp Rat
  • Posts: 650
Re: "tblnext" shows no group 3 for Textstyle
« Reply #13 on: November 03, 2014, 02:51:07 AM »
EDIT:
Added links at the end of the posting - maybe the solution in the last one


a) DXF-info
I checked the Xdata-code for textstyles using Arial - here are the fragments of the data, created with
Code - Auto/Visual Lisp: [Select]
  1. (entget (tblobjname "style" "standard") '("*"))

Code - Auto/Visual Lisp: [Select]
  1. Style set to "STANDARD"
  2. (3 . "arial.ttf") (4 . "") (-3 ("ACAD" (1000 . "Arial") (1071 . 34))))
  3. Style set to "Bold italic"
  4. (3 . "arialbi.ttf") (4 . "") (-3 ("ACAD" (1000 . "Arial") (1071 . 50331682))))
  5. Style set to "Italic"
  6. (3 . "ariali.ttf") (4 . "") (-3 ("ACAD" (1000 . "Arial") (1071 . 16777250))))
  7. Style set to "Bold"
  8. (3 . "arialbd.ttf") (4 . "") (-3 ("ACAD" (1000 . "Arial") (1071 . 33554466))))

b) Lisp-Problem
In the thread "How to get entire texstyle info via DBX?"
http://www.theswamp.org/index.php?topic=48124.msg531711#msg531711
member "MP" posted a code, I refer to this part:

Code - Auto/Visual Lisp: [Select]
  1. ...
  2.    
  3.     (defun @GetStylePropsAX ( style )    
  4.         (mapcar
  5.             (function (lambda (p) (cons p (@Try '(vlax-get style p)))))
  6.            '(   Name
  7.                 BigFontFile
  8.                 FontFile
  9.                 Height
  10.                 LastHeight
  11.                 ObliqueAngle
  12.                 TextGenerationFlag
  13.                 Width
  14.             )    
  15.         )
  16.     )
  17.    
  18.     (defun @GetStylePropsDXF ( style )    
  19.         (@Try
  20.            '(vl-remove-if
  21.                 (function
  22.                     (lambda ( p / key )
  23.                         (or
  24.                             (minusp (setq key (car p)))
  25.                             (< 70 key)
  26.                             (member key '(5))
  27.                         )
  28.                     )
  29.                 )
  30.                 (entget
  31.                     (vlax-vla-object->ename style)
  32.                 )
  33.             )      
  34.         )    
  35.     )
  36. ...
My idea was:
Quote
- save the entitylist of the style - if GC 3 is empty in the result - then use the stylename from entitylist - list xdata with (entget  (tblobjname... - read GC 1000 and 1071 - compare them with some value - create a new GC 3 based on 1000 and 1071 - subst the empty GC3 with the new GC3.
Sounds fine, works in the current drawing, but does not work with ODBX - the line with "tblobjectname" always creates nil.

Here is my code - really step-by-step and sedate (the "x" in the new fontnames are to differ the existing GCs from the created one):

Code - Auto/Visual Lisp: [Select]
  1. (defun @GetStylePropsDXF ( style  / temp props fontname typ gcnew)
  2.     (setq temp
  3.         (@Try
  4.        '(vl-remove-if ; entferne unerwünschte Gruppencodes
  5.             (function
  6.                 (lambda ( p / key )
  7.                     (or
  8.                         (minusp (setq key (car p))) ; negative Werte
  9.                         (< 70 key)                  ; Werte grösser 70
  10.                         (member key '(5))           ; Wert 5 = Handle
  11.                     )
  12.                 )
  13.             )
  14.            
  15.             ; Variante kurz: normales entget
  16.             (setq gcbase (entget (vlax-vla-object->ename style)))
  17.         )
  18.     )
  19.     ); end of temp
  20.     ; bei leerem GC 3 hole die Infos aus GC 1000 und 1071
  21.     (if (equal (cdr (assoc 3 temp)) "")
  22.         (progn
  23.             (princ "\nGCwechsel: ")
  24.             (setq stilname (cdr (assoc 2 gcbase)))
  25.             (setq props (entget (tblobjname "style" stilname) '("*"))) ; <<-- here is the problem
  26.             (setq fontname  (cdr (assoc 1000 (cdr (cadr (assoc -3 props)))))
  27.                   typ       (cdr (assoc 1071 (cdr (cadr (assoc -3 props)))))
  28.             )
  29.             (if (and fontname typ)
  30.                 (progn
  31.                     (if (equal (strcase fontname) "ARIAL")
  32.                         (cond
  33.                             ((= typ 34) ; Normal
  34.                                 (setq gcnew "arialx.ttf")
  35.                             )
  36.                             ((= typ 50331682) ; Bold italic
  37.                                 (setq gcnew "arialbix.ttf")
  38.                             )
  39.                             ((= typ 16777250) ; italic
  40.                                 (setq gcnew "arialix.ttf")
  41.                             )
  42.                             ((= typ 33554466)
  43.                                 (setq gcnew "arialbdx.ttf")
  44.                             )
  45.                             (t
  46.                                 (setq gcnew "arialy.ttf")
  47.                             )
  48.                         )
  49.                         (progn
  50.                             (setq gcnew (strcat fontname "-?.ttf"))
  51.                         )
  52.                     )
  53.                     (setq temp (subst (cons 3 gcnew) (assoc 3 temp) temp))
  54.                     (princ gcnew)
  55.                 )
  56.                 (princ "\nGCNew konnte nicht erstellt werden.")
  57.             )
  58.         ) ; progn
  59.     ); if
  60.     temp ; for return
  61. )

The basic question seem to be: Is "tblobjname" not allowed in DBX?

Thanks for your time.


Added:
There is a discussion "DBX & Xdata" which seem to be above my knowledge:
a) http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dbx-xdata/td-p/2060450
b) http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dbx-xdata-still-need-a-little-help/td-p/2060968
c) http://www.cadtutor.net/forum/showthread.php?66942-call-tblobjname-on-a-drawing-opened-as-ObjecDBX!-Is-it-possible&s=638bd79d19e8fabd34d0834f19a1e735
« Last Edit: November 03, 2014, 03:42:09 AM by Peter2 »
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: "tblnext" shows no group 3 for Textstyle
« Reply #14 on: November 03, 2014, 11:32:57 AM »
Apologies -- no time for a detailed answer -- you cannot use tblobjname on anything but the active document -- but no matter -- you can use (vlax-vla-object->ename textStyleObject) and whalla, you're examining the same entity as returned via tblobjname.

Observe:

Code: [Select]
(_Prinh
    (entget
        (tblobjname "style" "standard")
       '("*") ;; pull the xdata if there is any
    )
)

(
    (-1 . <Entity name: 7ffffc05cd0>)
    (0 . "STYLE")
    (330 . <Entity name: 7ffffc05830>)
    (5 . "55")
    (100 . "AcDbSymbolTableRecord")
    (100 . "AcDbTextStyleTableRecord")
    (2 . "Standard")
    (70 . 0)
    (40 . 0.0)
    (41 . 1.0)
    (50 . 0.0)
    (71 . 0)
    (42 . 4.0)
    (3 . "romans.shx")
    (4 . "")
)


Code: [Select]
(_Prinh
    (entget
        (vlax-vla-object->ename
            (vla-item
                (vla-get-textstyles
                    (vla-get-activedocument
                        (vlax-get-acad-object)
                    )
                )
                "standard"
            )
        )
       '("*") ;; pull the xdata if there is any
    )
)

(
    (-1 . <Entity name: 7ffffc05cd0>)
    (0 . "STYLE")
    (330 . <Entity name: 7ffffc05830>)
    (5 . "55")
    (100 . "AcDbSymbolTableRecord")
    (100 . "AcDbTextStyleTableRecord")
    (2 . "Standard")
    (70 . 0)
    (40 . 0.0)
    (41 . 1.0)
    (50 . 0.0)
    (71 . 0)
    (42 . 4.0)
    (3 . "romans.shx")
    (4 . "")
)


Notice the entity handles in both ("55"), i.e. same entity.

I used the active document here but I'm 99% certain it will work on documents opened via ObjectDBX.

If I had time I'd investigate.

I don't.

Cheers.

Regarding the imminent, "wtf is _prinh?" please see link.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst