Jump to content

Steve Alc

Member
  • Posts

    2
  • Joined

  • Last visited

Reputation

0 Neutral

Personal Information

  • Occupation
    Designer Mechanical, Electrical
  1. Thanks for the suggestion Raymond. I tried using this, based on the example in the help files. WHILE NOT GetPickObjectInfo(pX,pY,hPick,hSubObj,idummy) DO BEGIN GetPt(pX,pY); { gets mouse posn} END; cText:= GetRField(hPick,'Terminal Record','Terminal'); SetRField(hPIO,'Wire Record','Start', cText); It sort of works, in that I can read the data from the target object record and write it into my PIO record, but the pX, pY co-ordinates are always 0,0 I assume this is because VW is getting the co-ord relative to the PIO, not to the drawing. It always gets the data from the object at the drawing centre, even if I click on an object elsewhere. So then I tried using MouseDown ( and extending the routine to get both ends of my wire) Message('Click to place Wire Number text, Click on Start Item, Click on End Item'); REPEAT {Get Start Item} UNTIL MouseDown(rPx,rPy); bOK:=GetPickObjectInfo(rpX,rpY,hPick,hSubObj,idummy); cText:= GetRField(hPick,'Terminal Record','Terminal'); SetRField(hPIO,'Wire Record','Start', cText); REPEAT { Get end Item} UNTIL MouseDown(rPx,rPy); bOK:=GetPickObjectInfo(rpX,rpY,hPick,hSubObj,idummy); cText:= GetRField(hPick,'Terminal Record','Terminal'); SetRField(hPIO,'Wire Record','End', cText); It works! - except I have to click twice before anything happens, then it goes into the sequence as in the message. I assume that's something else I'm doing wrong. I've written a few scripts, but this is the first that really interacts with the user. Thanks for your help Steve
  2. Hi, I've just been trying to do a similar thing, starting with a wire number tool, that puts a text line of a number, colour and size on the drawing, calculating the next available number from the records of existing numbers. What I want to do is bring all the wire number records into a spreadsheet to creat a wirelist for a control board I'm now trying to extend it to read the start and end points from records of objects (terminals). I tried using GetPt() to pick the objects, but vectorworks crashes. Any suggstions on how to select the object the user clicks on?
×
×
  • Create New...