Jump to content
Developer Wiki and Function Reference Links ×

extracting PIO name


Recommended Posts

OK, so I have come to realize that

GetSymName(Objh)

is not going to give me the name of the PIO but can't seem to find the correct function.

Now this is not a Name as in Named objects but the name of the type of PIO if that makes any sense. Like the 'Angle' and 'Eye Bolt' PIO's.

Anyone know which function is required?

Thanks

Link to comment

All plugin objects have a record with the name of the plugin so you would need to get a handle to this record. In older versions, the parametric record would be the last one but now you can get a handle directly with GetParametricRecord.

PROCEDURE GetPio;
VAR 
pX,pY: REAL;
objHdl: HANDLE;
pioName: STRING;

FUNCTION GetPioName(pioHdl: HANDLE): STRING;
VAR
	recTot: INTEGER;
	recHdl: HANDLE;
BEGIN
IF GetType(pioHdl) = 86 THEN
	BEGIN
	recHdl:= GetParametricRecord(pioHdl);

{ or this code if an older version}
{		recTot:= NumRecords(pioHdl);
	recHdl:= GetRecord(pioHdl,recTot);
}
	GetPioName:= GetName(recHdl);
	END
ELSE
	GetPioName:= '';
END;
BEGIN
GetPt(pX,pY);
objHdl:= PickObject(pX,pY);
IF (objHdl <> NIL) THEN
BEGIN
pioName:= GetPioName(objHdl);
IF Len(pioName) > 0 THEN
	Message(pioName)
ELSE
	Message('Not a plug-in object');
END
ELSE
ClrMessage;
END;
Run(GetPio);

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...