VvierA Posted January 25, 2012 Share Posted January 25, 2012 Hello there, another simple question for a beginner like me: I generated a polyline with VS. Closepoly; Beginpoly; AddPoint(0,-(PBOXWIDTH/2)); AddPoint(pLINELENGTH,-(PBOXWIDTH/2)); AddPoint(pLINELENGTH,(pBOXWIDTH/2)-(gefprozentv*pLINELENGTH)); AddPoint(0,(PBOXWIDTH/2)); Endpoly; Now I want to change the visibility of the line segments with SetVertexVisibility. But I need a handle to the previously generated polyline. How do I get it? Thank you for help VvierA Quote Link to comment
JBenghiat Posted January 26, 2012 Share Posted January 26, 2012 Did you try LNewObj? There are a handful of objects which don't add them selves to the new object list. (groups, for example) For those, use what's known as the where's Waldo technique: Locus(0,0); waldo:=LNewObj; myHan:=PrevObj(waldo); DelObject(waldo); -Josh Quote Link to comment
VvierA Posted January 27, 2012 Author Share Posted January 27, 2012 LNewObj - that's it - thank you again. Quote Link to comment
Steve Cox Posted April 15, 2012 Share Posted April 15, 2012 Josh, thanks for posting this, I've just used your solution to fix a problem I had creating what I thought was going to be a simple script to duplicate an object and move the duplicate by its own width plus a constant. The LNewObj command failed utterly. Is it the command that creates the object that causes LNewObj to fail or the object type? My code was DUPLICATE(0,0); {the selected object} myHandle:=LNewObj; { get its handle } w:=HWIDTH(myHandle); { get dimension of object } HMOVE(myHan,0,w+3.5mm); { shift dimension plus 3.5mm } this fails to shift the duplicate whatever type of object it is. Adding your Waldo code fixed it , though I don't understand how it works. Steve MacOS 10.6.8 VW 2011 Quote Link to comment
MullinRJ Posted April 16, 2012 Share Posted April 16, 2012 Steve, ???The problem appears to be that DUPLICATE() does not update LNewObj, whereas LOCUS() does. So, using the Waldo technique will return the handle you are looking for. ???Waldo works because creating a locus will always create it in the present drawing context of the program - i.e., on a Design or Sheet Layer, or inside a Symbol, Group or other container object; and Locus() always updates LNewObj. Since new objects are always created on the top of the drawing stack, the PrevObj() to the locus (the one directly beneath it) is the Last-New-Object you were looking for. Once you get a handle to your object the locus can be (should be) thrown away. Now you know where Waldo 'was'. HTH, Raymond 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.