I tried to change the line thickness of titleBlock I drawed in VisualbasicScript Macro. I've used Visproperty function but it doesn't work.
If someone has done it, please send me an example that works.
ThanX
Hi
It's not obvious how the VisProperties works with significant reading of the API guide & crashing about a bit. The following code is a VBA (as debugging is easier) sub to change the line thickness & type of a line object.
This runs fine as script on V5R9
The sub takes 3 parameters
LineToChange as AnyObject (i.e. Line, circle, etc. Don't pass it anything the VisPropertySet methods cannot operate on as it will cause an error)
Thickness as long (This takes an whole number value 1 to 67 relating to the thicknesses shown in the line properties dialog)
LineType as long (This takes an whole number value 1 to 67 relating to the line types shown in the line properties dialog)
Hope this helps
Pete
'----------------------------------------------------------
'Change the line thickness & type of the object passed
'---------------------------------------------------------
Private Sub FormatLine(LineToChange As AnyObject, _
Thickness As Long, LineType As Long)
Dim SelectedStuff As Selection
Dim VisPropertiesOfSelection As VisPropertySet
'Connect to the selection object
Set SelectedStuff = DrwDocument.Selection
'Ensure selection object is empty
SelectedStuff.Clear
'Add the Item to the selection
SelectedStuff.Add LineToChange
'Connect to the visual properties of the selection
Set VisPropertiesOfSelection = SelectedStuff.VisProperties
'Change the visible width to the equired value
VisPropertiesOfSelection.SetVisibleWidth Thickness, 0
VisPropertiesOfSelection.SetRealLineType LineType, 0
'Clear the selection
SelectedStuff.Clear
'Release the objects
Set VisPropertiesOfSelection = Nothing
Set SelectedStuff = Nothing
End Sub