Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
drafting4KGWTN
266 Views, 5 Replies

Title Block Link to Excel to Update Single Sheet in Multi-Sheet IDW

Hi everyone,

 

my company is toying with the idea of using multi-sheet drawings for assembly (and sometimes multi-assembly) jobs.

Currently I've got some code working that will update the title & revision block (all custom iprops) of a single-sheet IDW. Trouble is, i cant adapt this code to work for a multi-sheet drawing file. I've been scouring the forums trying to find any relevant code to help, but the issue is the same. Running the rule updates ALL the title blocks in the sheet-set, as opposed to just the active sheet which is what I need.

 

Any help would be greatly appreciated.

 

Please see below for the current working code for a single-sheet IDW file:

I've also attached a dummy excel file for any testing

 

StrNum = InputBox("Please enter the JMG DRAWING NUMBER", "titty block")

I = GoExcel.FindRow("S:\A - DRAWINGS\DRAFTING from 2022\DRAWING REGISTER\Inventor Registers\HVO inventor.xlsm.xlsx", "sheet1", "JMG DRAWING NUMBER", "-", StrNum)
StrTitle = GoExcel.CurrentRowValue("Title")
StrCompany = GoExcel.CurrentRowValue("Company")
StrDesc = GoExcel.CurrentRowValue("Description")
StrProject = GoExcel.CurrentRowValue("Project")
StrRevisionNumber = GoExcel.CurrentRowValue("Register Revision Number")
StrJMGDrawingNumber = GoExcel.CurrentRowValue("JMG DRAWING NUMBER")
StrClientDrawingNumber = GoExcel.CurrentRowValue("CLIENT DRAWING NUMBER")
StrRevNoLine1 = GoExcel.CurrentRowValue("REF DRAWING NUMBER LINE 1")
StrRevDesLine1 = GoExcel.CurrentRowValue("REF DRAWING DESCRIPTION LINE 1")
StrRevNoLine2 = GoExcel.CurrentRowValue("REF DRAWING NUMBER LINE 2")
StrRevDesLine2 = GoExcel.CurrentRowValue("REF DRAWING DESCRIPTION LINE 2")
StrRevNoLine3 = GoExcel.CurrentRowValue("REF DRAWING NUMBER LINE 3")
StrRevDesLine3 = GoExcel.CurrentRowValue("REF DRAWING DESCRIPTION LINE 3")
StrRevNoLine4 = GoExcel.CurrentRowValue("REF DRAWING NUMBER LINE 4")
StrRevDesLine4 = GoExcel.CurrentRowValue("REF DRAWING DESCRIPTION LINE 4")
StrRevNoLine5 = GoExcel.CurrentRowValue("REF DRAWING NUMBER LINE 5")
StrRevDesLine5 = GoExcel.CurrentRowValue("REF DRAWING DESCRIPTION LINE 5")
StrRefDesLine1 = GoExcel.CurrentRowValue("Rev L1 Description")
StrRefAppLine1 = GoExcel.CurrentRowValue("Rev L1 Approved")
StrRefByLine1 = GoExcel.CurrentRowValue("Rev L1 By")
StrRefNoLine1 = GoExcel.CurrentRowValue("Rev L1 Number")
StrDateLine1 = GoExcel.CurrentRowValue("Rev L1 Date")
StrRefDesLine2 = GoExcel.CurrentRowValue("Rev L2 Description")
StrRefAppLine2 = GoExcel.CurrentRowValue("Rev L2 Approved")
StrRefByLine2 = GoExcel.CurrentRowValue("Rev L2 By")
StrRefNoLine2 = GoExcel.CurrentRowValue("Rev L2 Number")
StrDateLine2 = GoExcel.CurrentRowValue("Rev L2 Date")
StrRefDesLine3 = GoExcel.CurrentRowValue("Rev L3 Description")
StrRefAppLine3 = GoExcel.CurrentRowValue("Rev L3 Approved")
StrRefByLine3 = GoExcel.CurrentRowValue("Rev L3 By")
StrDateLine3 = GoExcel.CurrentRowValue("Rev L3 Date")
StrRefNoLine3 = GoExcel.CurrentRowValue("Rev L3 Number")
StrRefDesLine4 = GoExcel.CurrentRowValue("Rev L4 Description")
StrRefAppLine4 = GoExcel.CurrentRowValue("Rev L4 Approved")
StrRefByLine4 = GoExcel.CurrentRowValue("Rev L4 By")
StrRefNoLine4 = GoExcel.CurrentRowValue("Rev L4 Number")
StrDateLine4 = GoExcel.CurrentRowValue("Rev L4 Date")
StrRefDesLine5 = GoExcel.CurrentRowValue("Rev L5 Description")
StrRefAppLine5 = GoExcel.CurrentRowValue("Rev L5 Approved")
StrRefByLine5 = GoExcel.CurrentRowValue("Rev L5 By")
StrRefNoLine5 = GoExcel.CurrentRowValue("Rev L5 Number")
StrDateLine5 = GoExcel.CurrentRowValue("Rev L5 Date")
StrRefDesLine6 = GoExcel.CurrentRowValue("Rev L6 Description")
StrRefAppLine6 = GoExcel.CurrentRowValue("Rev L6 Approved")
StrRefByLine6 = GoExcel.CurrentRowValue("Rev L6 By")
StrRefNoLine6 = GoExcel.CurrentRowValue("Rev L6 Number")
StrDateLine6 = GoExcel.CurrentRowValue("Rev L6 Date")

iProperties.Value("Custom", "Drawing Number") = StrNum
iProperties.Value("Summary", "Title") = StrTitle
iProperties.Value("Summary", "Company") = StrCompany
iProperties.Value("Project", "Description") = StrDesc
iProperties.Value("Project", "Project") = StrProject
iProperties.Value("Custom", "JMG DRAWING NUMBER") = StrJMGDrawingNumber
iProperties.Value("Project", "Part Number") = StrClientDrawingNumber
iProperties.Value("Project", "Revision Number") = StrRevisionNumber
iProperties.Value("Custom", "REF DRAWING NUMBER LINE 1") = StrRevNoLine1
iProperties.Value("Custom", "REF DRAWING DESCRIPTION LINE 1") = StrRevDesLine1
iProperties.Value("Custom", "REF DRAWING NUMBER LINE 2") = StrRevNoLine2
iProperties.Value("Custom", "REF DRAWING DESCRIPTION LINE 2") = StrRevDesLine2
iProperties.Value("Custom", "REF DRAWING NUMBER LINE 3") = StrRevNoLine3
iProperties.Value("Custom", "REF DRAWING DESCRIPTION LINE 3") = StrRevDesLine3
iProperties.Value("Custom", "REF DRAWING NUMBER LINE 4") = StrRevNoLine4
iProperties.Value("Custom", "REF DRAWING DESCRIPTION LINE 4") = StrRevDesLine4
iProperties.Value("Custom", "REF DRAWING NUMBER LINE 5") = StrRevNoLine5
iProperties.Value("Custom", "REF DRAWING DESCRIPTION LINE 5") = StrRevDesLine5
iProperties.Value("Custom", "Rev L1 Description") = StrRefDesLine1
iProperties.Value("Custom", "Rev L1 Approved") = StrRefAppLine1
iProperties.Value("Custom", "Rev L1 By") = StrRefByLine1
iProperties.Value("Custom", "Rev L1 Number") = StrRefNoLine1
iProperties.Value("Custom", "Rev L1 Date") = StrDateLine1
iProperties.Value("Custom", "Rev L2 Description") = StrRefDesLine2
iProperties.Value("Custom", "Rev L2 Approved") = StrRefAppLine2
iProperties.Value("Custom", "Rev L2 By") = StrRefByLine2
iProperties.Value("Custom", "Rev L2 Number") = StrRefNoLine2
iProperties.Value("Custom", "Rev L2 Date") = StrDateLine2
iProperties.Value("Custom", "Rev L3 Description") = StrRefDesLine3
iProperties.Value("Custom", "Rev L3 Approved") = StrRefAppLine3
iProperties.Value("Custom", "Rev L3 By") = StrRefByLine3
iProperties.Value("Custom", "Rev L3 Number") = StrRefNoLine3
iProperties.Value("Custom", "Rev L3 Date") = StrDateLine3
iProperties.Value("Custom", "Rev L4 Description") = StrRefDesLine4
iProperties.Value("Custom", "Rev L4 Approved") = StrRefAppLine4
iProperties.Value("Custom", "Rev L4 By") = StrRefByLine4
iProperties.Value("Custom", "Rev L4 Number") = StrRefNoLine4
iProperties.Value("Custom", "Rev L4 Date") = StrDateLine4
iProperties.Value("Custom", "Rev L5 Description") = StrRefDesLine5
iProperties.Value("Custom", "Rev L5 Approved") = StrRefAppLine5
iProperties.Value("Custom", "Rev L5 By") = StrRefByLine5
iProperties.Value("Custom", "Rev L5 Number") = StrRefNoLine5
iProperties.Value("Custom", "Rev L5 Date") = StrDateLine5
iProperties.Value("Custom", "Rev L6 Description") = StrRefDesLine6
iProperties.Value("Custom", "Rev L6 Approved") = StrRefAppLine6
iProperties.Value("Custom", "Rev L6 By") = StrRefByLine6
iProperties.Value("Custom", "Rev L6 Number") = StrRefNoLine6
iProperties.Value("Custom", "Rev L6 Date") = StrDateLine6


MessageBox.Show("All properties have been applied to " & StrNum, "Success")