Results 1 to 6 of 6

Thread: Using OSnap override from OSnap menu inside a LISP routine

  1. #1
    Member
    Join Date
    2007-04
    Posts
    4
    Login to Give a bone
    0

    Default Using OSnap override from OSnap menu inside a LISP routine

    My office has a LISP routine written to create dimensions. For each of the dimensions (linear, aligned, angle, etc.) there is an OSMODE specified to control the snap points.

    I have tried to modify this code and have changed the OSMODE binary indication (setvar "OSMODE" 3) and a line that looks like this (setq PT2 (osnap PT1 "endp,mid")) to the osnap settings we want.

    The problem i'm running into is that when using this dimension, if you shift-right-click to choose any other osnap, it looks like it allows you to use another osnap (shows the icon when near the point snapping to) but then it only snaps to the closest osnap point defined by the above code. For example, shift-right-click, select intersection, shows the intersection X icon, click at the intersection, and the dimension point is actually at a nearby midpoint or endpoint (the two osnaps allowed by the set OSMODE).

    Before i made the change, it would allow you to override, now it does not. Can anyone shed light on this conundrum?

    Thank you.
    ..eran

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,504
    Login to Give a bone
    0

    Default Re: Using OSnap override from OSnap menu inside a LISP routine

    Hmmm...
    What is your APERTURE set at?
    This sets the object snap taget height in pixels, I use "10".

    .....Just a thought
    Last edited by tedg; 2007-04-26 at 06:05 PM.

  3. #3
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Using OSnap override from OSnap menu inside a LISP routine

    Would it be possible to insert (setvar "OSMODE" 0) before allowing a user choice?

  4. #4
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,504
    Login to Give a bone
    0

    Default Re: Using OSnap override from OSnap menu inside a LISP routine

    Quote Originally Posted by eed
    My office has a LISP routine written to create dimensions. For each of the dimensions (linear, aligned, angle, etc.) there is an OSMODE specified to control the snap points.

    I have tried to modify this code and have changed the OSMODE binary indication (setvar "OSMODE" 3) and a line that looks like this (setq PT2 (osnap PT1 "endp,mid")) to the osnap settings we want.

    The problem i'm running into is that when using this dimension, if you shift-right-click to choose any other osnap, it looks like it allows you to use another osnap (shows the icon when near the point snapping to) but then it only snaps to the closest osnap point defined by the above code. For example, shift-right-click, select intersection, shows the intersection X icon, click at the intersection, and the dimension point is actually at a nearby midpoint or endpoint (the two osnaps allowed by the set OSMODE).

    Before i made the change, it would allow you to override, now it does not. Can anyone shed light on this conundrum?

    Thank you.
    ..eran
    So you have osmode set to 3 and "endp, mid" within your routine?
    jaberwok (John B) may have something there, (setvar osmode "0") may work better for you.
    and/or maybe take out the "endp, mid"
    ..just another thought.

  5. #5
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    0

    Default Re: Using OSnap override from OSnap menu inside a LISP routine

    Can you post your code? It appears that your OSMODE is set correctly while you are picking your points. However, when the code creates the dimension or other object, the OSMODE is not disabled (set to 0) prior to the object's creation through the command function. This should not be a problem if using entmake or other VLISP or VBA solutions.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  6. #6
    I could stop if I wanted to tyshofner's Avatar
    Join Date
    2004-03
    Location
    Dallas, Tx
    Posts
    229
    Login to Give a bone
    0

    Default Re: Using OSnap override from OSnap menu inside a LISP routine

    Code:
     (setq PT2 (osnap PT1 "endp,mid"))
    I'm assuming the PT1 variable is the actual user pick, correct? If this is true then I think the code in red is the problem. The osnap function takes a supplied point and "snaps" to another point on an object based on the supplied osnap settings ("endp,mid"). So basically, the code in red is taking the supplied point (PT1, whether it was selected using the (3) setting of osmode, or by a user over-ridden osmode setting) and then setting PT2 based on a "snap" to the "endp,mid" of the object passing through PT1.

    I hope you can understand that!?!? To summarize it sounds like you would just like to use PT1 as your point. So you could either:

    Code:
     (setq PT2 PT1)
    or just remove that line of code, and anywhere PT2 was used supply PT1 instead.

    Ty

Similar Threads

  1. OSNAP Menu
    By jmw in forum AMEP General
    Replies: 2
    Last Post: 2009-09-27, 01:21 PM
  2. Lost my Osnap menu
    By arcadia_x27 in forum ACA General
    Replies: 3
    Last Post: 2006-09-13, 06:38 PM
  3. Modifying the OSNAP Menu
    By BrenBren in forum AutoCAD CUI Menus
    Replies: 5
    Last Post: 2005-08-09, 09:36 PM
  4. Osnap cursor menu not quite working.
    By Glenn Pope in forum AutoCAD CUI Menus
    Replies: 11
    Last Post: 2005-07-14, 03:01 PM
  5. Can you turn off OSNAP from inside Macros?
    By Adam R. in forum AutoCAD Customization
    Replies: 15
    Last Post: 2005-04-21, 10:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •