- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I like to change some text with iLogic
It is easy get it to make it bolt or change the font, but i like to change the justification of the text.
Where can i find a list of style override functions?
If you find this reply helpful ? It would be nice if you use the Accept as Solution or Kudos button below.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Robert,
In the Inventor help, API help, do a search on "GeneralNote object" and "TextStyle Object"
You get a list of all the properties you can set.
maybe create a few Textstyles with the justifications you need, and change the textstyle for the text you want to change.
Kudo's are also appreciated
Succes on your project, and have a nice day
Herm Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Robert
you have to see iLogic as VB.net light.... and the api (application programmer interface) is the link between VB and Inventor.
there you can find all the things you can do with code in Inventor, that Autodesk lets you do.
Autodesk makes the API, and decide what is, and is not in the API.
when you look at the weld annotation, you can change only 2 or three objects, but there are many more that you can't program.
So the answer to you question is that with both iLogic and VB you can't fully program the weld symbol.
you can vote for this Idea:
Kudo's are also appreciated
Succes on your project, and have a nice day
Herm Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
you wrote: So the answer to you question is that with both iLogic and VB you can't fully program the weld symbol.
But that is not my question...
What i like to change is the justification of some text with ilogic.
Now i have: TempPartNo = "<StyleOverride Font='ISOCP_IV25' FontSize='0.5' Bold='False' Underline='False' HorizontalJustification='0'>" & TempPartNo & "</StyleOverride>" and i like to add something to change the justification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Not sure if there is a list anywhere,
BUT you can always change the text manually (through the UI) then read the .formattedtext on that text box to see what tags they use to set the style overrides.
Keep in mind that those format tags only show up for OVERRIDES and do not appear if the base style used for that text matches for the styles that are not overridden.
--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization
iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread
Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects
Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help
Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Robert,
I was misstaking with the weld annotation, you question looked alot like an other question, so I gave the wrong answer.
would it be possible for you to share a part with the text not good, and one how it should be?
I thing that the best way it to create two or more tetstyles so you can choose the right textstyle for your part.
then if you want you can automate this
Kudo's are also appreciated
Succes on your project, and have a nice day
Herm Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I already found that it is not possible to do with iLogic.
What I can change is:
SyntaxEditor Code Snippet
"<StyleOverride Font='ISOCP_IV25' FontSize='0.5' Bold='False' Underline='False' HorizontalJustification='0'>" & TempPartNo & "</StyleOverride>"
You can change the font, but not a Style or the Justification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Robert,
try this iLogic rule in a drawing. create some Text in the drawing and run the rule.
depending on the line(s) that are not commented, the justification will change...
(iLogic has VB.net in the Back, so you can run VB.net code in iLogic)
Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveDocument Dim oPickedDrawingNote As Inventor.DrawingNote = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingNoteFilter, "Select text") oPickedDrawingNote.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextCenter ' oPickedDrawingNote.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft ' oPickedDrawingNote.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextRight ' ' oPickedDrawingNote.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextBaseline this option gives me an error oPickedDrawingNote.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextLower ' oPickedDrawingNote.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextMiddle ' oPickedDrawingNote.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextUpper
Kudo's are also appreciated
Succes on your project, and have a nice day
Herm Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My bad, I did not mentioned that i like to change text on a part, not in a drawing.
I would like to place text on the flatt pattern, like a part number to use for laser engraving.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello Robert,
it's almost the same, this should do it
Dim oPartDoc As Inventor.PartDocument = ThisApplication.ActiveDocument Dim oText As TextBox = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketchTextBoxFilter, "Select a text") oText.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextCenter 'oText.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft 'oText.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextRight 'oText.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextBaseline oText.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextLower 'oText.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextMiddle 'oText.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextUpper
Kudo's are also appreciated
Succes on your project, and have a nice day
Herm Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Herm Jan,
Thanks for the help.
I have now what I like to have:
SyntaxEditor Code Snippet
Dim oDoc As PartDocument = ThisDoc.Document Dim oDef As SheetMetalComponentDefinition = oDoc.ComponentDefinition Dim oSK As Sketch = oDef.FlatPattern.Sketches(1) TempPartNo = Replace(iProperties.Value("Project", "Part Number"), ".", "") TempPartNo = "<StyleOverride Font='ISOCP_IV25' FontSize='0.5' Bold='False' Underline='False'>" & TempPartNo & "</StyleOverride>" oSK.TextBoxes.Item(1).HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft oSK.TextBoxes.Item(1).FormattedText = TempPartNo '.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextCenter '.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft '.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextRight '.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextBaseline '.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextLower '.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextMiddle '.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextUpper