VS:DTM6 IsTypeVisible

From Vectorworks Developer
Revision as of 18:29, 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

Check if the specified TIN type of the specified Site Model object is visible.

FUNCTION DTM6_IsTypeVisible(
hDTMObject :HANDLE;
TINType :INTEGER) :BOOLEAN;
def vs.DTM6_IsTypeVisible(hDTMObject, TINType):
    return BOOLEAN

Parameters

hDTMObject HANDLE A handle to the Site Model object.
TINType INTEGER A number specifying which TIN type is to be check for visibility. See the remarks for detail information of the options.

Return Value

Returns TRUE if the specified TIN type is visible; FALSE if not or incorrect TIN type is specified.

Remarks

Here is the list of TINType values. The function will return TRUE when these conditions are met. 2DDisplay and 3DDisplay are parameters of the Site Model object controlling if the Existing or Proposed model are to be displayed in 2D or 3D:

  • 0 - 2D/3D existing -- IF (2DDisplay == Existing) OR (2DDisplay == ExistingOrProposed) OR (3DDisplay == Existing) THEN RETURN TRUE
  • 1 - 2D/3D proposed -- IF (2DDisplay == Proposed) OR (2DDisplay == ExistingOrProposed) OR (3DDisplay == Proposed) THEN RETURN TRUE
  • 2 - 2D existing -- IF (2DDisplay == Existing) OR (2DDisplay == ExistingOrProposed) THEN RETURN TRUE
  • 3 - 2D proposed -- IF (2DDisplay == Proposed) OR (2DDisplay == ExistingOrProposed) THEN RETURN TRUE
  • 4 - 3D existing -- IF (3DDisplay == Existing) THEN RETURN TRUE
  • 5 - 3D proposed -- IF (3DDisplay == Proposed) THEN RETURN TRUE

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_GetDTMObject]] | [[VS:DTM6_IsDTM6Object]] | [[VS:DTM6_IsObjectReady]]