VS:DTM6 SendToSurface: Difference between revisions
m (1 revision) |
No edit summary |
||
Line 58: | Line 58: | ||
::IF (2DDisplay == Proposed) OR (2DDisplay == ExistingOrPoposed) OR (3DDisplay == Proposed) THEN GetZ from [Proposed Surface] | ::IF (2DDisplay == Proposed) OR (2DDisplay == ExistingOrPoposed) OR (3DDisplay == Proposed) THEN GetZ from [Proposed Surface] | ||
::ELSE GetZ from [Existing Surface] | ::ELSE GetZ from [Existing Surface] | ||
[[User:Ptr|Ptr]] [2020.09.14]:When applying this call on a 2D object, that 2D object gets converted into a 3D polygon. The handle to the 2D object will not be linked to this 3D polygon. "vs.LNewObj()" will not return the handle to the 3D polygon. | |||
</remark> | </remark> | ||
Line 63: | Line 64: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<sample> | <sample> | ||
==== Python ==== | |||
<code lang="py"> | |||
_, _sPIOName, _hPIO, _hPIORecord, _hWall = vs.GetCustomObjectInfo() # Get info from current PIO instance | |||
_hPath = vs.GetCustomObjectPath(_hPIO) | |||
_hDTM = vs.DTM6_GetDTMObject(vs.GetLayer(_hPIO), False) # Get Site Model on the PIO's layer | |||
_hPoly2D = vs.HDuplicate(_hPath, 0, 0) | |||
_b = vs.DTM6_SendToSurface(_hDTM, _hPoly2D, 0) | |||
vs.Locus(0, 0) # Create a dummy object | |||
_h = vs.LNewObj() | |||
_hPoly3D = vs.PrevObj(_h) | |||
vs.DelObject(_h) # Delete the dummy object | |||
</code> | |||
</sample> | </sample> | ||
Latest revision as of 07:43, 3 February 2021
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Send the specified object to the surface of the SiteModel specified.
NOTE! The 3D polygons receive new points where it crosses the SiteModel.
FUNCTION DTM6_SendToSurface(
hDTMObject :HANDLE;
hObject :HANDLE;
TINType :INTEGER) :BOOLEAN;
def vs.DTM6_SendToSurface(hDTMObject, hObject, TINType): return BOOLEAN
Parameters
hDTMObject HANDLE A handle of the Site Model object to be used. hObject HANDLE A handle of the object to be send to surface. TINType INTEGER A number identifying the Site Model surface (existing or proposed) which elevation is to be calculated.
Return Value
Returns TRUE if succeeds.
NOTE! The 3D polygons receive new points where it crosses the SiteModel.
Remarks
The values of TINType are one of:
- 0 - existing - calculates the Z elevation of the point on the existing surface
- 1 - proposed - calculates the Z elevation of the point on the proposed surface
- 2 - current - depends on the 2D and 3D display parameter of the Site Model. If either of them is proposed then this mode works as '1' otherwise it works as '0'
- The logic is:
- IF (2DDisplay == Proposed) OR (2DDisplay == ExistingOrPoposed) OR (3DDisplay == Proposed) THEN GetZ from [Proposed Surface]
- ELSE GetZ from [Existing Surface]
Ptr [2020.09.14]:When applying this call on a 2D object, that 2D object gets converted into a 3D polygon. The handle to the 2D object will not be linked to this 3D polygon. "vs.LNewObj()" will not return the handle to the 3D polygon.
Example
Python
_, _sPIOName, _hPIO, _hPIORecord, _hWall = vs.GetCustomObjectInfo() # Get info from current PIO instance _hPath = vs.GetCustomObjectPath(_hPIO) _hDTM = vs.DTM6_GetDTMObject(vs.GetLayer(_hPIO), False) # Get Site Model on the PIO's layer _hPoly2D = vs.HDuplicate(_hPath, 0, 0) _b = vs.DTM6_SendToSurface(_hDTM, _hPoly2D, 0) vs.Locus(0, 0) # Create a dummy object _h = vs.LNewObj() _hPoly3D = vs.PrevObj(_h) vs.DelObject(_h) # Delete the dummy object
Version
Availability: from All Versions
This is drop-in function.
See Also
VS:DTM6_GetDTMObject | VS:DTM6_IsDTM6Object | VS:DTM6_IsObjectReady | VS:DTM6_IsTypeVisible