Message 1 of 5
creating a textstyletablerecord
Not applicable
11-28-2005
12:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am trying to create a new text style with ARX called "SIMPLEX".
Here is my code: AcDbTextStyleTableRecord *pTSRec; pTSRec = new AcDbTextStyleTableRecord(); stat = pTSRec->setName("SIMPLEX"); stat = pTSRec->setFileName("C:\\PROGRAM FILES\\AUTOCAD 2002\\SUPPORT\\SIMPLEX.shx"); stat = pTSRec->setBigFontFileName("C:\\PROGRAM FILES\\AUTOCAD 2002\\SUPPORT\\SIMPLEX.shx");
stat = pTSRec->setXScale(1.0);
stat = pTSRec->setTextSize(0.125);
pTSRec->setIsShapeFile(Adesk::kTrue);
AcDbTextStyleTable *pTextStyleTable;
stat =currDocData.pCurrentDB-> getSymbolTable(pTextStyleTable,AcDb::kForWrite); AcDbObjectId simplexId; if (stat == Acad::eOk){ stat = pTextStyleTable->add(simplexId,pTSRec); } pTextStyleTable->close();
I know that getting the current database pointer scheme I am using works because I use it to add a pline to this same drawing with it. It seems like I am setting way more things than I should have to, but I kept setting more stuff when it would not work. I tried setting the file names without the full path first. How do I know it does not work? I use the text style dialog box to verify that the new style is not there. After I do this code I am making 3 new mtext entities and adding them to the data base. I set them with the simplexID objectId. When I look in the drawing, they do not appear, but when I do a do a list of ALL the entities in the drawing, they are listed out. That is how I got onto the textsyletablerecord problem. I thought that the fact that the Simplex style is not created, but that I had set the mtexts with it was the reason that they were not drawn on the screen, even though they were successfully added to the data base.
Also, to let you know, I have also tried to create with isShapeFile set as not true. Neither way works.
Thank you,
rlarxman
I am trying to create a new text style with ARX called "SIMPLEX".
Here is my code: AcDbTextStyleTableRecord *pTSRec; pTSRec = new AcDbTextStyleTableRecord(); stat = pTSRec->setName("SIMPLEX"); stat = pTSRec->setFileName("C:\\PROGRAM FILES\\AUTOCAD 2002\\SUPPORT\\SIMPLEX.shx"); stat = pTSRec->setBigFontFileName("C:\\PROGRAM FILES\\AUTOCAD 2002\\SUPPORT\\SIMPLEX.shx");
stat = pTSRec->setXScale(1.0);
stat = pTSRec->setTextSize(0.125);
pTSRec->setIsShapeFile(Adesk::kTrue);
AcDbTextStyleTable *pTextStyleTable;
stat =currDocData.pCurrentDB-> getSymbolTable(pTextStyleTable,AcDb::kForWrite); AcDbObjectId simplexId; if (stat == Acad::eOk){ stat = pTextStyleTable->add(simplexId,pTSRec); } pTextStyleTable->close();
I know that getting the current database pointer scheme I am using works because I use it to add a pline to this same drawing with it. It seems like I am setting way more things than I should have to, but I kept setting more stuff when it would not work. I tried setting the file names without the full path first. How do I know it does not work? I use the text style dialog box to verify that the new style is not there. After I do this code I am making 3 new mtext entities and adding them to the data base. I set them with the simplexID objectId. When I look in the drawing, they do not appear, but when I do a do a list of ALL the entities in the drawing, they are listed out. That is how I got onto the textsyletablerecord problem. I thought that the fact that the Simplex style is not created, but that I had set the mtexts with it was the reason that they were not drawn on the screen, even though they were successfully added to the data base.
Also, to let you know, I have also tried to create with isShapeFile set as not true. Neither way works.
Thank you,
rlarxman