VS:DTM6 SendToSurface

From Vectorworks Developer
Revision as of 18:43, 22 November 2010 by Root (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

.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]

Example

VectorScript

PROCEDURE Example;
VAR
hDTM :HANDLE;
hPoly3D : HANDLE;
x :REAL;
y :REAL;
z :REAL;
result :BOOLEAN;
BEGIN
	Poly(0,0,-0.5,1,0.5,1.5,2,1,1,-0.5);
	hPoly3D := LObject;
	hDTM := DTM6_GetDTMObject(ActLayer, True);
	IF DTM6_IsDTM6Object(hDTM) AND DTM6_IsObjectReady(hDTM) THEN 
	BEGIN
		IF DTM6_IsTypeVisible(hDTM, 4{is existing visible in 3D}) THEN 
		BEGIN
			result :=DTM6_GetZatXY(hDTM, 0{Existing}, x, y, z);
			result :=DTM6_SendToSurface(hDTM, hPoly3D, 0{Existing} );
		END else
		BEGIN
			result :=DTM6_GetZatXY(hDTM, 1{Proposed}, x, y, z);
			result :=DTM6_SendToSurface(hDTM, hPoly3D, 1{Proposed} );
		END;
	END;
END;
RUN(Example);

Python

def Example():
	vs.Poly(0,0,-0.5,1,0.5,1.5,2,1,1,-0.5)
	hPoly3D = vs.LObject()
	hDTM = vs.DTM6_GetDTMObject(vs.ActLayer(), True)
	if vs.DTM6_IsDTM6Object(hDTM) and vs.DTM6_IsObjectReady(hDTM):
		if vs.DTM6_IsTypeVisible(hDTM, 4):
			result, z = vs.DTM6_GetZatXY(hDTM, 0, x, y)
			result = vs.DTM6_SendToSurface(hDTM, hPoly3D, 0 )
		else:	
			result, z = vs.DTM6_GetZatXY(hDTM, 1, x, y)
			result = vs.DTM6_SendToSurface(hDTM, hPoly3D, 1)

Example()

Version

Availability: from All Versions

This is drop-in function.

See Also

VS:DTM6_GetDTMObject | VS:DTM6_IsDTM6Object | VS:DTM6_IsObjectReady | VS:DTM6_IsTypeVisible

[[VS:DTM6_GetDTMObject]] | [[VS:DTM6_IsDTM6Object]] | [[VS:DTM6_IsObjectReady]] | [[VS:DTM6_IsTypeVisible]]