SebastianTheCrab Posted June 18, 2015 Share Posted June 18, 2015 The source of the problem is a helper function drawportsegment: (defun drawportsegment (loc portspacing / portw porth test) (setq portw 2.0 porth 1.0) (command "rectangle" (list (- (car loc) (/ portw 2.0)) (cadr loc) 0.0) (list (+ (car loc) (/ portw 2.0)) (- (cadr loc) porth) 0.0)) (command "line" (list (car loc) (- (cadr loc) porth) 0.0) (list (car loc) (- (cadr loc) portspacing) 0.0) "") ) As it is relevant information, the test function I wrote to interface with drawportsegment is testdps: (defun c:testdps (/ loc portspacing) (setq loc (getpoint "\nwhere?") portspacing 2.0) (drawportsegment loc portspacing)) Here is a direct comparison of this function running on-screen vs. off-screen: I do not understand why figure A is generated, as I would think from looking at the code that figure B would always be generated. All help is appreciated! Quote Link to comment Share on other sites More sharing options...
Commandobill Posted June 18, 2015 Share Posted June 18, 2015 (setvar 'osmode 0) Quote Link to comment Share on other sites More sharing options...
Commandobill Posted June 18, 2015 Share Posted June 18, 2015 To explain: When the object is on the screen your osnaps are active, this if you get the current osmode and set it to variable, then change the osmode to 0 while your program is running, then it will not snap to an object, then you turn it back to what it was. Quote Link to comment Share on other sites More sharing options...
SebastianTheCrab Posted June 18, 2015 Author Share Posted June 18, 2015 It worked - thank you! Quote Link to comment Share on other sites More sharing options...
Commandobill Posted June 18, 2015 Share Posted June 18, 2015 No problem Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 19, 2015 Share Posted June 19, 2015 A suggestion the changing of osmode is pretty common in lots of situations. (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) .... your code ... (setvar 'osmode oldsnap) Quote Link to comment Share on other sites More sharing options...
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.