Hot News:

Mit Unterstützung durch:

  Foren auf CAD.de (alle Foren)
  CATIA V5 Programmierung
  Macro for exporting Tif and for modify text

Antwort erstellen  Neues Thema erstellen
CAD.de Login | Logout | Profil | Profil bearbeiten | Registrieren | Voreinstellungen | Hilfe | Suchen

Anzeige:

Darstellung des Themas zum Ausdrucken. Bitte dann die Druckfunktion des Browsers verwenden. | Suche nach Beiträgen nächster neuer Beitrag | nächster älterer Beitrag
Autor Thema:  Macro for exporting Tif and for modify text (571 mal gelesen)
lukeumbo
Mitglied


Sehen Sie sich das Profil von lukeumbo an!   Senden Sie eine Private Message an lukeumbo  Schreiben Sie einen Gästebucheintrag für lukeumbo

Beiträge: 2
Registriert: 03.12.2018

CATIA V5 R24

erstellt am: 03. Dez. 2018 12:11    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities


Macro-ToTif.zip

 
Hi to all,

-------------------------------------------------------------------------------------------------------------------------------

Often I need to export many CatDrawing to tif.

I want to set a directory for input and one for output. Drawings may contain multiple sheets.
I have 2 scripts (see attachments). Each one do partially what I want to do.
One script can manage multiple sheets but convert only 1 file and it need to be open.
The other script don't need that the Drawings are open but it don't manage multiple sheets and convert only the active sheet.

Is there a way to "merge" these script to do the whole work?
I don't know vba or scripting so I can't understand if it's possible to do.
-------------------------------------------------------------------------------------------------------------------------------

The second question is about texts.

Our title block is automatically generated by the system when I create a Drawing.

I want to change some text size/Ratio/Spacing with a macro.

I tried this (actually only for text size):

Language="VBSCRIPT"
Sub CATMain()
Dim drawingDocument1 As Document
Set drawingDocument1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = drawingDocument1.Selection
selection1.Search "Name=Testo.180,all"
Set A3 = selection1
A3.SetFontSize 0,0,2.2

The macro won't work and break on "A3.SetFontSize 0,0,2.2".

I've found "SetFontSize" on a tutorial but I can't understand if is wrong the command or the way I used it.

For Texts Ratio and Spacing is there a command? I can find anything on the net

-------------------------------------------------------------------------------------------------------------------------------

I'm on Catia R24

p.s.: sorry for my bad english 


Thanks
LuKe

Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP

bgrittmann
Moderator
Konstrukteur


Sehen Sie sich das Profil von bgrittmann an!   Senden Sie eine Private Message an bgrittmann  Schreiben Sie einen Gästebucheintrag für bgrittmann

Beiträge: 11780
Registriert: 30.11.2006

CATIA V5R19

erstellt am: 03. Dez. 2018 13:28    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities Nur für lukeumbo 10 Unities + Antwort hilfreich

Hi Luke

Welcome to the forum.
Your code is not working, because you have to apply the method to a text and not to the whole selection:

Code:
Set A3 = selection1.item2(1).value  '1st selected element
A3.SetFontSize 0,0,2.2
Text ration and spacing should work as following (not tested):
Code:
A3.SetParameterOnSubString catCharRatio, 0, 0, 2
A3.SetParameterOnSubString catCharSpacing, 0, 0, 2
Regards,
Bernd

------------------
Warum einfach, wenn es auch kompliziert geht.

Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP

lukeumbo
Mitglied


Sehen Sie sich das Profil von lukeumbo an!   Senden Sie eine Private Message an lukeumbo  Schreiben Sie einen Gästebucheintrag für lukeumbo

Beiträge: 2
Registriert: 03.12.2018

CATIA V5 R24

erstellt am: 04. Dez. 2018 16:32    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities

It works fine

Many thanks for your support

If you have any advise for my other problem about exporting in tif it will be welcome 

LuKe

Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP

Anzeige.:

Anzeige: (Infos zum Werbeplatz >>)

Darstellung des Themas zum Ausdrucken. Bitte dann die Druckfunktion des Browsers verwenden. | Suche nach Beiträgen

nächster neuerer Beitrag | nächster älterer Beitrag
Antwort erstellen


Diesen Beitrag mit Lesezeichen versehen ... | Nach anderen Beiträgen suchen | CAD.de-Newsletter

Administrative Optionen: Beitrag schliessen | Archivieren/Bewegen | Beitrag melden!

Fragen und Anregungen: Kritik-Forum | Neues aus der Community: Community-Forum

(c)2023 CAD.de | Impressum | Datenschutz