Sub Main() If oDoc_Type <> "Drawing" Then MessageBox.Show("This is not a drawing document.", "ALERT!") Exit Sub Else oDWG() End If End Sub Sub oDWG() oModelDoc = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName) 'save text parameter "MyText" value in the string variable Value 'Dim Value As String = Parameter(oModelDoc, "Length") 'Note: this string Value could be read from any source (e.g., excel sheet). Dim oDoc As DrawingDocument = ThisDrawing.Document Dim oSheet As Sheet oSheet = oDoc.ActiveSheet Dim oView As DrawingView 'oView = oSheet.DrawingViews.Item(1) Dim oGeneralDimensions As GeneralDimensions oGeneralDimensions = oSheet.DrawingDimensions.GeneralDimensions Dim oSSet As SelectSet = oDoc.SelectSet 100: obj = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "Select drawing dimension") Dim oLWT_Array As New ArrayList oLWT_Array.add("LENGTH") oLWT_Array.add("WIDTH") oLWT_Array.add("HEIGHT") If TypeOf obj Is GeneralDimension Then 'reference to the selected dimension Dim oDim As GeneralDimension = obj 'refrence to the DimensionText object Dim oDimensionText As DimensionText = oDim.Text oLWT_Array_IP = InputListBox("SELECT FROM ABOVE!", oLWT_Array, oLWT_Array.Item(0), "OVER ALL SIZES", "OPTIONS") If Left(oDimensionText.Text,1) = "(" Then oTxt_SizeOA = Right(oDimensionText.Text, Len(oDimensionText.Text)-1) Else oTxt_SizeOA = oDimensionText.Text End If If Right(oTxt_SizeOA,1) = ")" Then oTxt_SizeOA = Left(oTxt_SizeOA, Len(oTxt_SizeOA)-1) MessageBox.Show("Message: " & oTxt_SizeOA, "Title") 'iProperties.Value(oModelDoc, "Custom", oLWT_Array_IP) = oTxt_SizeOA iProperties.Value(oModelDoc, Parameter.Param("Length")) = oTxt_SizeOA 'oDimensionText.Text MessageBox.Show("Cutom iProperty: " & oLWT_Array_IP & " - Updated!", "Title") End If oYN = MessageBox.Show("DO YOU WANT TO CONTINUE? ", "CONTINUE: YES or NO", MessageBoxButtons.YesNo) If oYN = vbYes Then Goto 100: 'Beep End Sub Function oDoc_Type() oDoc = ThisApplication.ActiveDocument 'check file type If oDoc.DocumentType = kPartDocumentObject Then oReturn = "Part" Else If oDoc.DocumentType = kAssemblyDocumentObject Then oReturn = "Assembly" Else If oDoc.DocumentType = kDrawingDocumentObject Then oReturn = "Drawing" End If Return oReturn End Function