-
Posts
800 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Marionette
Store
Posts posted by Hippocode
-
-
I guess its all about the " Alternate Name" in the parameters setup.
Too bad I can't find the script space in the plugin list
I did find the fieldname by accident, but is there a way to list the fieldnames of each property of a plugin object/tool ?
-
From what I know, each object has an asigned record where the data is stored.
This way, in a database record we can retrieve data this way: objectname.fieldname
This works for most fieldnames, but not for all. Is this because the fieldnames are language based so we need the real variable name ?
If so, where do we get them ?
For example Object space:
space.length gives me the length of the space.
space.'ceiling height' doesn't return anything
Both length as ceiling height are parameters in the shape pallette of the object "space"..
-
Forgot to mention -- just to make sure you're not reinventing the wheel, have you checked out the select similar tool?
-Josh
The select similar tool is different as it will select ALL possible symbols when clicking on one.
The tool I made will only select the "kind" of symbols I select.
If I want to change All my lights named L1, I just need to click one and the script will select all placed L1 symbols in the layer.
Select similar tool would select all symbols instead.
If not, i'm a fool. (edit: never noticed the tool properties could be changed. Thus i'm a fool lol, good practice though.)
As a sidenote I ran into another problem.
when trying to select the basic objects ( text, line ) the command doesn't respond, even if the string is right.
t_temp:=concat(BNames[j]); {this returns Text}
UprString(t_temp); {make it TEXT}
test:=concat('T=',t_temp); {create T=TEXT to select all text objects}
SelectObj((test)); {no text gets selected ?}
-
I think what you're after is the Plug-in name of a Plug-In Object (PIO). You can get the name of the PIO's data record -- GetName(GetRecord(h, 1)). Your selection criteria, would use PON=.
-Josh
Ah, exactly what I was looking for, thanks.
-
Hey,
I recently made a small plugin object trough the plug-in editor(Tools=>scripts=>vw plugin editor).
Its ment to be a heat device drawn as a rectangle and some info in it.
I've added it to my post, use it as a plug in object or look at the code of it to give you a heads up..
PROCEDURE Radiator;VAR
bc_ht,bc_wid,bc_height,bc_vermogen,i: REAL;
bc_fontsize,keuzes,height,numberpos : INTEGER;
objname,vermogen,bc_number: STRING;
bc_textposition,bc_numberposition: CHAR;
oh,rh,wh: HANDLE;
result,hidetext,shownumber: BOOLEAN;
BEGIN
{ retrieve custom object information }
result:= GetCustomObjectInfo(objname,oh,rh,wh);
{ if object information was successfully retrieved }
IF result THEN BEGIN
{ retrieve predefined parameter values }
bc_ht := PRWIDTH;
bc_wid := PRLENGTH;
bc_height := PRHEIGHT;
bc_vermogen := PVERMOGEN;
bc_textposition := PSHOW_VERMOGEN;
bc_numberposition := PSHOW_NUMBER;
bc_fontsize := PFONTSIZE;
bc_number := PNUMBER;
vermogen:=concat(bc_vermogen,' W');
{ retrieve user-defined parameter values }
{ draw }
i:=0";
PushAttrs;
FillPat(0);
{ draw rectangle with coordinates }
Rect(0,bc_ht,bc_wid,0);
{ draw text }
TextFont(GetFontID('Monaco'));
TextSize(bc_fontsize);
TextJust(2);
hidetext :=true;
shownumber :=true;
CASE bc_textposition OF
'O': height :=bc_ht+25;
'I': height :=bc_ht;
'H': hidetext :=false;
OTHERWISE height :=bc_ht+25;
END;
IF hidetext THEN BEGIN
TextOrigin(bc_wid/2,height);
BeginText;
vermogen
EndText;
END;
CASE bc_numberposition OF
'L': BEGIN numberpos :=3;height:=-5; END;
'R': BEGIN numberpos :=1;
height:=bc_wid+5;
END;
'H': shownumber :=false;
OTHERWISE BEGIN numberpos :=3;
height:=-5; END;
END;
IF shownumber THEN BEGIN
TextJust(numberpos);
TextOrigin(height,bc_ht);
BeginText;
bc_number
EndText;
END;
PopAttrs;
END;
END;
Run(Radiator);
-
In best case,
GetName(h) was able to return "none" which indicates the plugin object has no name.
The same result with custom and standard plugin objects while they do have a "name" or lets say a "title" in the object info palette. Its that value I need in order to select the object. Anyone ?
-
I know I can retrieve the type with GetType(h); and change the selection code to retrieve all " lines " etc.
But I still can't get the objects

-
Hello,
I've made a script to select ALL symbols in a layer, where atleast one of them is allready selected.
I'd like to extend it for other objects(plugin, line, text etc) but I fail at getting the names of the selected objects.
I know i'll have to change the selection part, but I just need to find a way to get the selected objects info
PROCEDURE SelectObjects;
VAR
OCount,i,j: INTEGER;
r, g, b :LONGINT;
OName,OName2,OName3,strinkie,test,selectie :STRING;
ONames : DYNARRAY[] of STRING;
FUNCTION SelectThem(h :HANDLE) :BOOLEAN;
BEGIN
OName := GetSymName(h);
IF OName ='' THEN BEGIN
OName := GetName(h); {can't get the object name ?}
END;
ONames:=OName;
i:=i+1;
END;
BEGIN
selectie:='Geselecteerde symbolen: ';
OCount:=NumSelectedObjects;
IF OCount<2 THEN OCount:=2;
i:=1;
ALLOCATE ONames [1..OCount];
ForEachObjectInLayer(SelectThem, 2, 0, 0);
SortArray(ONames,OCount,1);
DSelectAll;
FOR j:=1 TO OCount DO BEGIN
IF OName2<>ONames[j] THEN BEGIN
strinkie:=concat(ONames[j]);
OName2:=strinkie;
SelectObj((S=strinkie));
selectie:=concat(selectie,strinkie,', ');
END;
END;
AlrtDialog(selectie);
END;
RUN(SelectObjects);
-
It seems like I was combining the both. I can indeed just retrieve it that easily, thanks for helping out though

-
Hey,
I've been making my own objects and would like to have a custom list of choice in the object shape tab.
This can be made by setting the parameter to "pop up" but I fail at getting the data from that popup into my vectorscript?
Can anyone point me into the right direction ?
I've noticed its not possible by doing variable :=PFIELDNAME;...

Sorting numbers in subrows
in Resource Share - Worksheets
Posted · Edited by hippothamus
The Descending and Ascending Sort function in the worksheet are nice but don't work properly on numbers placed in a text field.
A lot of PIOS use a number to trace them, ideal to list them in a worksheet. Sadly, that number is stored as a string and won't sort properly
Sorting will give the following:
1
10
11
2
21
22
3
4
5
6
7
8
9
Is there any way to sort them the right way and not tread them as if they were strings ??