View Label Left Text Alignment

View Label Left Text Alignment

jR0sal3s
Advocate Advocate
1,022 Views
6 Replies
Message 1 of 7

View Label Left Text Alignment

jR0sal3s
Advocate
Advocate

Could anybody help with Macro coding so if i run it, the text in the view label would align to the left and to the left most of the drawing view as well?

 

And where could i find the syntax on macro coding?

 

Looking forward, Thanks a lot..

jR

0 Likes
Accepted solutions (2)
1,023 Views
6 Replies
Replies (6)
Message 2 of 7

MechMachineMan
Advisor
Advisor
Accepted solution
THe top right corner of your inventor program... Cick the question mark drop down, and find the "Programming Help"

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
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
0 Likes
Message 3 of 7

jR0sal3s
Advocate
Advocate

Yes, i did that but im just beginning to learn it...and could not make anything work...so i've research to find the following, cut and paste to the macro but wont run though...is there anyway to convert the syntax to make it readable in the macro..?.(i'd like to understand the syntax in the macro works against other languages)

 

Dim oDoc As DrawingDocument = ThisDoc.Document
Dim oSheets As Sheets = oDoc.Sheets
Dim oView As DrawingView
For Each oSheet In oSheets
    For Each oView In oSheet.DrawingViews
        If Not oView.Label.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft Then
            oView.Label.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft
        End If
    Next
Next

 

0 Likes
Message 4 of 7

MechMachineMan
Advisor
Advisor
If it contains "set", it is vba and should be used in the Macro Editor. If
it doesn't, just use it in a rule.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
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
0 Likes
Message 5 of 7

jR0sal3s
Advocate
Advocate
yes it runs in a rule, but would you be able to convert it to a macro syntax?..i d like to learn how it is being translated..and from there maybe I will develop my own..thanks
0 Likes
Message 6 of 7

MechMachineMan
Advisor
Advisor
Yes. Add "Set" in front of lines with =.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
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
0 Likes
Message 7 of 7

jR0sal3s
Advocate
Advocate
Accepted solution

finally..so, thanks for giving me the clue! and here it goes...

 

Dim _Doc As DrawingDocument

_Doc = _invApp.ActiveDocument

Dim _Sheets As Sheets

_Sheets = _Doc.Sheets

Dim _View As DrawingView

For Each _Sheet In _Sheets

For Each _View In _Sheet.DrawingViews

If Not _View.Label.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft Then

_View.Label.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft

End If

Next

Next

 

jR

0 Likes