Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ilogic code to add reference brackets to all dimensions for a list of drawings

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
waynehelley
2278 Views, 5 Replies

ilogic code to add reference brackets to all dimensions for a list of drawings

I already have a code below that will read a bunch of drawing filenames that will go into each drawing, save the drawing, (print the drawing but I have this disabled for now,) close it, then move onto the next one.

 

What I want to do is add reference brackets around every dimension on each drawing.  Does anyone have an idea about how to do this?  I have managed to update part list styles before using ilogic but I am not sure if it is possible with dimensions.

 

Thanks,

 

Wayne

 

 

question = MessageBox.Show("Are you sure you want to update multiple drawings? If so, please make sure all drawings are checked out.", "Batch Drawing Update",MessageBoxButtons.YesNo,MessageBoxIcon.Question)

 

'set condition based on answer

If question = vbNo

Exit Sub

End If

 

spreadsheet = InputBox("The Batch Drawing Update requires a spreadsheet with a list of drawings you wish to update. Please enter the location and file name of the spreadsheet you wish to use.", "Batch Drawing Update", "C:\Users\wayne.helley\Documents\iLogic\Drawing\Batch Drawing Update")

 

location = InputBox("Please input the location of the folder which contains the drawings you wish to print.", "Batch Drawing Update", "C:\ARTICULATE\09\090\09090PT0000048")

 

'printer = InputBox("Please input the location of the printer you wish to use.", "Batch Drawing Update", "\\it-brd-prtsrv\BRD-COLOUR-DUPLEX")

 

 

GoExcel.Open(spreadsheet, "Sheet1")

 

'create lists

Dim DrawingList As New ArrayList

Dim row As Integer

 

                For row = 1 To 1000

                                'Exits the FOR function when reaching the end of the list

                                If (GoExcel.CellValue("A" & row) = "") Then

                                Exit For

                                End If

                DrawingList.add(GoExcel.CellValue("A"& row))

                                                                                               

                Next

               

Dim oString as Object

i = 0

 

For Each oString in DrawingList

 

'Open Drawing

ThisDoc.Launch(location & "\" & DrawingList.Item(i) & ".idw")

 

Dim oDrawingDoc As DrawingDocument

oDrawingDoc = ThisApplication.ActiveDocument

               

'Dim oPrintMgr As PrintManager

'

'

' oPrintMgr = oDrawingDoc.PrintManager

' 'specify your printer name

' oPrintMgr.Printer = printer

'

'oPrintMgr.ColorMode = kPrintDefaultColorMode

'oPrintMgr.Orientation = kLandscapeOrientation

'oPrintMgr.PaperSize = SizeActiveSheet

'oPrintMgr.SubmitPrint

 

oDrawingDoc.Save

 

 

oDrawingDoc.Close(True)

 

i=i+1

 

Next

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
5 REPLIES 5
Message 2 of 6

 

Hi waynehelley,

 

Here's a quick snippet that might help. Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

' Set a reference to the select set of the active document.
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument

' Find all selected occurrences and add them to an ObjectCollection.
Dim oDrawingDims As DrawingDimension

'Loop through all dimensions
For Each oDrawingDims In oDoc.ActiveSheet.DrawingDimensions
'set the Tolerance Method
'oDrawingDims.Tolerance.SetToDefault
'oDrawingDims.Tolerance.SetToBasic
oDrawingDims.Tolerance.SetToReference
Next

 

Message 3 of 6

Thanks Curtis. That works perfectly!

 

I am always unsure what forum to use for ilogic questions but I will post in the Customization forum from now on.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 4 of 6


@waynehelley wrote:

I am always unsure what forum to use for ilogic questions but I will post in the Customization forum from now on.


Hi waynehelley,

 

Personally, I think iLogic questions fit best in the customization forum, but I don't get to hung up on that sort of thing, and so I try to answer questions where ever they land.

 

However, I serach for and find a lot of my answers to iLogic coding questions by searching the customization forums, so I try and point it out so that people know it's there. I think a lot of new forum users overlook it.

 

Happy to hear that worked,
Curtis
http://inventortrenches.blogspot.com

Message 5 of 6

is it possible to use this code to "Hide Dimension Value" on all dimensions in one drawing?
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
--
F.Goncalves
Message 6 of 6

I am very basic beginner in ilogic, your codes are very simple to understand.

i am very much impressed by making codes simpler and easy to understand.

 

can you give me a iLogic simple code to ask the user to select a dimension.

once selected the dimension has to change to 3 decimal places with symmetric tolerance .030 added to the dimension.

the next line of the dimension showing a text T.S.C

 

is it difficult to code? please help

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report