Replace borders in older drawings using iLogic

Replace borders in older drawings using iLogic

wilson.broeksema
Contributor Contributor
2,071 Views
3 Replies
Message 1 of 4

Replace borders in older drawings using iLogic

wilson.broeksema
Contributor
Contributor

Hello,

 

I've create 5 new custom borders named A4, A3, A2, A1 and A0. I've stored them in to template standard.dwg.

 

For older drawings I'd like to replace the border with one of the previous ones matching the sheet size. 

If this can be done automatically that would be great, but I'm also satisfied if I get an arraylist with choices.

 

I've already created some code. It deletes the border and copies the resources from the template. It also comes up with an arraylist. As said, the arraylist is not neccessary.

 

Who can help me finishing the code?

 

'delete sheet formats
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveEditDocument

Dim oCurrentNumber  As Sheet
oCurrentNumber = oDoc.ActiveSheet

' Iterate through the sheets, and delete the title blocks and symbols
Dim oSheet As Sheet
For Each oSheet In oDoc.Sheets
    oSheet.Activate
    
Try
oSheet.Border.Delete
Catch
'catch error if no border found
End Try
   
ThisDrawing.ResourceFileName = "\\nlassapp04\Data\NXTdim\InvSet2016\Templates\standard.dwg"
ThisDrawing.KeepExtraResources = True


Dim resu1t As String="Result"
Dim T1TLE As New ArrayList
T1TLE.Add("A4")
T1TLE.Add("A3")
T1TLE.Add("A2")
T1TLE.Add("A1")
T1TLE.Add("A0")

resu1t=InputListBox("Select Drawing Border", T1TLE, resu1t, _
Title := "Border", ListName := "Borders from Template")

Next

Thanks in advance.

 

Wilson

0 Likes
Accepted solutions (2)
2,072 Views
3 Replies
Replies (3)
Message 2 of 4

blandb
Mentor
Mentor
Accepted solution

Since you have your resource file defined, you should be able to use:

 

Change Border function:

ActiveSheet.Border="<New Border Name>"

 

Or

 

Change Border (2) - Incorporate prompted entries:

ActiveSheet.SetBorder("<New Border Name>", "promptedEntry1", "promptedEntry2")

 

Autodesk Certified Professional
Message 3 of 4

mcgyvr
Consultant
Consultant
Accepted solution

Have you looked into just using the "Drawing Resource Transfer Wizard" utility located in your start menu Inventor folder..?



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 4 of 4

wilson.broeksema
Contributor
Contributor

Yes I did, but not applicable since all our drawings are in Vault and in different folders.

0 Likes