Inventor : Activation de cartouche a haut a droite avec i-logic

Inventor : Activation de cartouche a haut a droite avec i-logic

denis.semeniuc
Advocate Advocate
384 Visites
6 Réponses
Message 1 sur 7

Inventor : Activation de cartouche a haut a droite avec i-logic

denis.semeniuc
Advocate
Advocate

Bonjour,

 

Comment activer le cartouche a haut a gauche de la page.

 

je utilise ca :

 

ActiveSheet.ChangeSize("B", moveBorderItems := True)
ThisApplication.ActiveDocument.ActiveSheet.Orientation  = kLandscapePageOrientation
ActiveSheet.Border = "Cadre large(PE)"
	ActiveSheet.SetTitleBlock("MPE")

 

denissemeniuc_0-1707793728460.png

Merci de votre aide


Le titre du sujet a été modifié par un modérateur pour faciliter la recherche. Titre original:
Activation de cartouche a haut a droite avec i-logic

0 J'aime
Solutions acceptées (3)
385 Visites
6 Réponses
Replies (6)
Message 2 sur 7

A.Acheson
Mentor
Mentor
Solution acceptée

Hi @denis.semeniuc 

 

The titleblock location is only available using the Inventor API. See LocationEnum here

 

To use the locationenum you need to get the location property of the titleblock

Syntax

TitleBlock.Location() As TitleBlockLocationEnum

 

To use the titleblock you can add this from the sheet using add titleblock where you can set location, definition and prompted entry in one go. 

Syntax

Sheet.AddTitleBlockTitleBlockDefinition As Variant, [TitleBlockLocation] As Variant, [PromptStrings] As Variant ) As TitleBlock

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 J'aime
Message 3 sur 7

FINET_Laurent
Advisor
Advisor
Solution acceptée

Hello @denis.semeniuc,

 

You can use The folowing code to plate a titleblock in the desired location. The sheet must not contain existing titlelbocks & don't forget to update the name of the titleblock accordingly :

Dim titleblockName As String = "ISO"

Dim doc As Inventor.DrawingDocument =   ThisApplication.ActiveDocument
Dim s As Inventor.Sheet = doc.ActiveSheet

Dim def As Inventor.TitleBlockDefinition = doc.TitleBlockDefinitions.Item(titleblockName)

's.AddTitleBlock(def, TitleBlockLocationEnum.kBottomRightPosition) 
's.AddTitleBlock(def, TitleBlockLocationEnum.kBottomLeftPosition)
s.AddTitleBlock(def, TitleBlockLocationEnum.kTopRightPosition)
's.AddTitleBlock(def, TitleBlockLocationEnum.kTopLeftPosition)

 

Kind regards,

FINET L.

If this post solved your question, please kindly mark it as "Solution"

If this post helped out in any way to solve your question, please drop a "Like"

@LinkedIn     @JohnCockerill

0 J'aime
Message 4 sur 7

denis.semeniuc
Advocate
Advocate

Merci pour le code.

 

il y a une erreur :

denissemeniuc_1-1707832282298.png

je bien mis le nom du cartouche

denissemeniuc_0-1707832225713.png

 

 

0 J'aime
Message 5 sur 7

denis.semeniuc
Advocate
Advocate
Désolé, je trouver l'erreur.

le TitleBlock été avec entrance(il faut écrire les donne) c'et ne marche pas avec cette fonction.
Il y a la possibilité applique la même chose pour cartouche avec Entrance?
0 J'aime
Message 6 sur 7

FINET_Laurent
Advisor
Advisor
Solution acceptée

@denis.semeniuc

 

Yes you can, but you need to create an array that contains the value for all prompt entries. Here an example with a title block that has two prompt entries :

Dim titleblockName As String = "TEST"
Dim data As String() = {"Value1", "Value2"}

Dim doc As Inventor.DrawingDocument =   ThisApplication.ActiveDocument
Dim s As Inventor.Sheet = doc.ActiveSheet

Dim def As Inventor.TitleBlockDefinition = doc.TitleBlockDefinitions.Item(titleblockName)

's.AddTitleBlock(def, TitleBlockLocationEnum.kBottomRightPosition, data) 
's.AddTitleBlock(def, TitleBlockLocationEnum.kBottomLeftPosition, data)
s.AddTitleBlock(def, TitleBlockLocationEnum.kTopRightPosition, data)
's.AddTitleBlock(def, TitleBlockLocationEnum.kTopLeftPosition, data)

 

Kind regards,

FINET L.

If this post solved your question, please kindly mark it as "Solution"

If this post helped out in any way to solve your question, please drop a "Like"

@LinkedIn     @JohnCockerill

0 J'aime
Message 7 sur 7

denis.semeniuc
Advocate
Advocate

Merci, ca Marche très bien.

 

0 J'aime