LarryO Posted March 9, 2015 Share Posted March 9, 2015 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 Quote Link to comment
Miguel Barrera Posted March 10, 2015 Share Posted March 10, 2015 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); Quote Link to comment
LarryO Posted March 11, 2015 Author Share Posted March 11, 2015 Thanks Miguel That was the little tidbit that I needed. Quote Link to comment
Recommended Posts
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.