Difference between revisions of "VS:IFC GetSpaceParamFO"

From Vectorworks Developer
Jump to: navigation, search
 
(One intermediate revision by one user not shown)
Line 39: Line 39:
 
</lineList>
 
</lineList>
 
</params>
 
</params>
 +
 +
-----------------------------------------------------------------------------------------------------------
 +
<return></return>
  
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------
Line 52: Line 55:
 
VAR
 
VAR
 
hSpace : HANDLE;
 
hSpace : HANDLE;
ok : BOOLEAN;
+
ok : BOOLEAN;
res : STRING;
+
res : STRING;
 
 
 
BEGIN
 
BEGIN
hSpace := FSObject( LActLayer );
+
hSpace := FSObject( FLayer );
 
if ( hSpace <> nil ) then
 
if ( hSpace <> nil ) then
 
begin
 
begin
Line 77: Line 80:
 
==== Python ====
 
==== Python ====
 
<code lang="py">
 
<code lang="py">
hSpace = vs.FSObject( vs.LActLayer )
+
hSpace = vs.FSObject( vs.FLayer() )
 
if hSpace != vs.Handle(0):
 
if hSpace != vs.Handle(0):
 
# We suggest the handle is a handle to Space object.
 
# We suggest the handle is a handle to Space object.

Latest revision as of 15:01, 17 December 2018

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Gets the space type, name or number of the Space object.
FUNCTION IFC_GetSpaceParamFO(
hSpace  :HANDLE;
inStrParam  :STRING;
VAR outStrResult  :STRING) : BOOLEAN;
def vs.IFC_GetSpaceParamFO(hSpace, inStrParam):
    return (BOOLEAN, outStrResult)

Parameters

hSpace HANDLE Handle to the Space object.
inStrParam STRING The Space param value. "1" for Space Type. "2" for Space Name. "3" for Space Number.
outStrResult STRING The result.

Example

To use the sample you need to have a selected Space object on the drawing.

VectorScript

PROCEDURE Test;
VAR
	hSpace	: HANDLE;
	ok	: BOOLEAN;
	res	: STRING;
	
BEGIN
	hSpace	:= FSObject( FLayer );
	IF ( hSpace <> NIL ) THEN
	BEGIN
		{We suggest the handle is a handle to Space object.}
		{Additional verification could be done.}
		
		{Get the Space Type}
		ok	:= IFC_GetSpaceParamFO( hSpace, '1', res );

		{Get the Space Name}
		ok	:= IFC_GetSpaceParamFO( hSpace, '2', res );
		
		{Get the Space number}
		ok	:= IFC_GetSpaceParamFO( hSpace, '3', res );
	END;
END;

RUN(Test);

Python

hSpace	= vs.FSObject( vs.FLayer() )
if hSpace != vs.Handle(0):
	# We suggest the handle is a handle to Space object.
	# Additional verification could be done.
		
	res	= ''
	
	# Get the Space Type
	ok	= vs.IFC_GetSpaceParamFO( hSpace, '1', res )

	# Get the Space Name
	ok	= vs.IFC_GetSpaceParamFO( hSpace, '2', res )
		
	# Get the Space number
	ok	= vs.IFC_GetSpaceParamFO( hSpace, '3', res )

Version

Availability: from Vectorworks 2017
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox