ike.eisenstadt
2004-12-10, 03:51 PM
I have written some code that allows me to manipulate multiple lights in a drawing (change all their intensities, etc...). I believe that most of the information that describes a particular light is stored in the xdata for that block. but I am having trouble determining just where beam and field angle info is kept...
In fact can anyone describe what the 22 pieces of xdata for a spotlight are??
Thanks
Oh btw---Here is the little piece of code that changes all the spotlights intensity (at least if their name stats with "HL"
Sub DimHouselights()
'Variable Dimesions Block
Dim Element As Object
Dim ArrayAttributes As Variant
Dim xdataOut, result As Variant
Dim xtypeOut As Variant
'{End Variable Dimensions}
On Error Resume Next
result = InputBox("Set lights at??")
For Each Element In ThisDrawing.ModelSpace
'Check for attributes within blocks
If Element.EntityType = 7 Then 'Test if it is a block
If Element.Name = "sh_spot" Then
ArrayAttributes = Element.GetAttributes
If (Left$(ArrayAttributes(0).TextString, 2) = "HL") Then
Element.GetXData "", xtypeOut, xdataOut
xdataOut(5) = result
Element.SetXData xtypeOut, xdataOut
End If
End If
End If
Next
End Sub
In fact can anyone describe what the 22 pieces of xdata for a spotlight are??
Thanks
Oh btw---Here is the little piece of code that changes all the spotlights intensity (at least if their name stats with "HL"
Sub DimHouselights()
'Variable Dimesions Block
Dim Element As Object
Dim ArrayAttributes As Variant
Dim xdataOut, result As Variant
Dim xtypeOut As Variant
'{End Variable Dimensions}
On Error Resume Next
result = InputBox("Set lights at??")
For Each Element In ThisDrawing.ModelSpace
'Check for attributes within blocks
If Element.EntityType = 7 Then 'Test if it is a block
If Element.Name = "sh_spot" Then
ArrayAttributes = Element.GetAttributes
If (Left$(ArrayAttributes(0).TextString, 2) = "HL") Then
Element.GetXData "", xtypeOut, xdataOut
xdataOut(5) = result
Element.SetXData xtypeOut, xdataOut
End If
End If
End If
Next
End Sub