Auto fill-in of prompted entry text

Auto fill-in of prompted entry text

Anonymous
Not applicable
1,007 Views
1 Reply
Message 1 of 2

Auto fill-in of prompted entry text

Anonymous
Not applicable

I am wanting to know if it is possible to use iLogic to copy a value from iProperties into a Field text.

As I am not a programmer I can not easily come up with the syntax.

 

The field text is located in the title block and is for the sheet scale pulled from the base view of the sheet.

I am wanting to do this so the sheet scale is no longer hand entered. There is too much room for error (sausage fingers) for this method to continue.

 

What I am trying to figure out is: field text."dwg scale" = custom iproperties. "Scale #"

 

Below is the code that I have. The line of code (in red) is just wrong.

 

Any ideas? maybe the code to accomplish this?

Any other ideas how to automate this to remove the possibility of human error?

 

Any assistance would be greatly appreciated.

 

' Sheet scale from base view

Dim odrawdoc As DrawingDocument

odrawdoc = ThisApplication.ActiveDocument

customPropertySet = odrawdoc.PropertySets.Item("Inventor User Defined Properties")

'i is a counter so that each cycle through this it increments i

For i = 1 To odrawdoc.Sheets.Count

'Make sure the desired property exists

Try

  prop = customPropertySet.Item("Scale" + Str(i))

Catch

'Assume error means not found and create custom iProperty

 customPropertySet.Add("", "Scale" + Str(i))

End Try

'set value of custom iProperty = base view scale for the sheet

Try

iProperties.Value("Custom", "Scale" + Str(i)) = odrawdoc.sheets.item(i).DrawingViews.Item(1).ScaleString

Catch

End Try

Next i

InventorVb.DocumentUpdate()

 

Try

odrawdoc."Sheet:1".TitleBlock.Value("DWG SCALE") = iProperties.Value("Custom", "Scale 1")

Catch

End Try

1,008 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Here is an "update" line of code to replace my previous line that was highlighted in red.

This still does not work but it does not cause errors or warnings when closing the iLogic editor.

 

'set base view scale to title block field text

Try

odrawdoc.sheets.item(1).TitleBlock.PropertyField.Value("Prompted Entry", "DWG SCALE") = iProperties.Value("Custom", "Scale 1")

Catch

End Try

 

To clarify, if it is needed, I am just trying to write a Custom iProperty to a prompted entry field in my title block.

 

Again any and all assistance wouuld be greatly appreciated.