Novice iLogic Question: Styles vs. iLogic Text

Novice iLogic Question: Styles vs. iLogic Text

cadman777
Advisor Advisor
531 Views
6 Replies
Message 1 of 7

Novice iLogic Question: Styles vs. iLogic Text

cadman777
Advisor
Advisor

This is a novice question about TEXT in idw View Labels.

 

When you add text to a view label using iLogic, does the formatting take on the characteristics of the default Style if no formatting is specified?

 

Reason I ask is b/c all the code I have seen uses StyleOverride, which sounds to me like its IGNORING the idw Style and making the text format particular to that iLogic occurrence (which is a bad practice when creating company Standards).

 

What I'm trying to understand is how to use the default idw Style, or how to CALL an existing idw style in iLogic, and make the text string use that style when formatting text entries made w/iLogic code.

 

Can someone shed some light on this for me please?

 

Thanx ...

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
532 Views
6 Replies
Replies (6)
Message 2 of 7

MjDeck
Autodesk
Autodesk

Yes, a view label that you create through iLogic will use the default Label Text style from the document.
You can override that by setting the DrawingViewLabel.TextStyle property.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 3 of 7

cadman777
Advisor
Advisor

Thanx Mike!

 

Is there an iLogic command I can use to cycle through all the Styles in the idw file so I can set the Stile I want as default?

 

I see no reason to 'reinvent the wheel' by piling code upon code when I can use what's already done inside the idw Template, eh?

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 4 of 7

Sergio.D.Suárez
Mentor
Mentor

Try this rule, take the styles that are located in the file, or in file and library, not to load all styles of the library (if it were a template). Then create a dialog box with the selected style. regards

 

Dim oDoc As Inventor.DrawingDocument = ThisDoc.Document
Dim dsm As DrawingStylesManager = oDoc.StylesManager

Dim oValueList As New ArrayList

For Each oTextStyle As TextStyle In dsm.TextStyles
	If oTextStyle.StyleLocation = 51202 Or oTextStyle.StyleLocation = 51201 Then 
		oValueList.Add(oTextStyle.Name)
	End if
Next

Dim oValue As String = InputListBox("Select the type of layer in the label text", oValueList, "", "TextStyles", "Available Selections")

For Each oTextStyle As TextStyle In dsm.TextStyles
	If oValue = oTextStyle.Name Then
		oSize = oTextStyle.FontSize
		oFont = oTextStyle.Font
		MessageBox.Show( "FontSize: " & oSize)
		MessageBox.Show("Font: " & oFont)
	End If	
Next

 


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 5 of 7

cadman777
Advisor
Advisor

Sergio,

Thanx for this excellent 'rule'!

It has 2 thing I would change if I knew how:

1. The 'Message Box' size should be adjustable

2. The options in the 'Message Box' are incorrect.

Instead, the blow pic shows what options I was referring to.Styles_Message_Box_OPTIONS_01a.jpg

Cheers!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 6 of 7

Sergio.D.Suárez
Mentor
Mentor
I hope this can help you. regards

 

Dim oDoc As Inventor.DrawingDocument = ThisDoc.Document
Dim dsm As DrawingStylesManager = oDoc.StylesManager

Dim oValueList As New ArrayList

For Each oDSStyle As DrawingStandardStyle In dsm.StandardStyles
	If oDSStyle.StyleLocation = 51202 Or oDSStyle.StyleLocation = 51201 Then 
		oValueList.Add(oDSStyle.Name)
	End If
Next

Dim oValue As String = InputListBox("Select the type of DrawingStandardStyle", oValueList, "", "DrawingStandardStyle", "Available Selections")

 


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 7 of 7

cadman777
Advisor
Advisor

Thanx for the info and code Sergio!

 

OK, here's what I'm thinking, and correct me if I'm mistaken:

 

I have Styles I use on every drawing.

I do not want to change those styles.

I want iLogic macros to use those styles.

But the particular style must match the macro.

So if I make flat pattern views, I need to first activate my flat pattern Style.

Result: I want to make a macro that first gives me the MessageBox for me to pic the correct Style, then after "OK" the macro runs and processes all the parts into views using the Style I picked at the beginning of the macro.

 

Make sense?

 

Then after all those views are created, I see that each view needs more information, such as 'Total Qty Req'd = XX' and total length and total width of flatpattern. So I would then run a macro that adds that information to the existing label. But that is another subject for another thread. Everything comes in proper order.

 

The reason I want to do that process is to use the tools already available in Inventor, and not re-construct everything from scratch. Why have those tools if you don't use them? If programming makes everything from scratch, then why have inventor at all? Why not just get Inventor OEM and work in that software? My point: I want iLogic to SUPPLEMENT my normal Inventor work-flow, not REPLACE it.

 

See my point?

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes