PDA

View Full Version : location



r.vetrano
2005-11-25, 06:55 PM
Hi
In the samples there is something like this

Public Function Location(ByRef elem As Revit.Element)
' do have a location data?
Dim loc As Location = elem.Location

If (loc Is Nothing) Then
MsgBox("no location data")
End If
' show it. Currently, we only support curve type.
Dim crv As LocationCurve = loc
If Not (crv Is Nothing) Then
Dim startPt As Geometry.XYZ = crv.Curve.StartPoint
Dim endPt As Geometry.XYZ = crv.Curve.EndPoint
End If
End Function

‘ from this I can read the startpt.x etc and Endpt.x etc is there a way change the x,y,z values and have them returned to elem.location?
I thought I had read somewhere that once exposed the location could be changed. I might be wrong because I can not find it again.

bob v

Danny Polkinhorn
2005-11-25, 08:48 PM
Bob,

I can't see a way to do this. The Location property is read-only. You can create a new curve with the NewLine method of the application object, but you can't assign this back to the element. At least that's how I'm reading it. It appears that all you can do with the Location is move or rotate it.