Author Topic: Examples of usage GRREAD - let's share  (Read 200520 times)

0 Members and 1 Guest are viewing this topic.

ribarm

  • Gator
  • Posts: 3264
  • Marko Ribar, architect
Re: Examples of usage GRREAD - let's share
« Reply #270 on: February 14, 2022, 12:04:20 PM »
I just wanted to point that there are more examples of GrSnap I worked on...

http://www.theswamp.org/index.php?topic=57360

BTW. I had a time to study GrSnap more (did a few testings); and finally I've decided to modify it slighty - it looks that now it works better (changes reflect in sub function : "LM:grsnap:displaysnap") - prviously it had some issues with not overlapping original OSNAP with GrSnap markers...

Regards, M.R.
« Last Edit: February 19, 2022, 03:48:17 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3264
  • Marko Ribar, architect
Re: Examples of usage GRREAD - let's share
« Reply #271 on: June 27, 2022, 11:36:21 PM »
Let's share ???
 8-)
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Examples of usage GRREAD - let's share
« Reply #272 on: August 10, 2023, 11:21:05 AM »
I know this is an older thread, but I realized I never posted my PolarSnap Routine. My routine will snap to the polar snap settings or you can specify a specific angle to match or if you want to allow mirrored angles of that angle, please see comments in LISP file. You can also adjust the sensitivity of the snapping.

There is a fair amount of code by others in here as well, I tried to give credit where credit is due, but if you see some of your work uncredited, please let me know so I can fix it.

You would call it something like this:
Code: [Select]
(while (not *StopLoop*)   
        (setq Input (grread T 4 4)
              Code (car Input)
              Data (cadr Input)
        )
        (redraw)
        (cond
          ((= Code 5)
            (setq Pt1 (trans InsPt 1 0)
                  Pt2 (trans Data 1 0)
                  FxPt (PolarSnap Pt1 Pt2 nil nil)
                  ;Alternative: FxPt (PolarSnap Pt1 Pt2 Match_Angle Last_Angle)
            )           
            (grdraw Pt1 FxPt 3 1)
          )
        )
      )

Of course you would adjust the code above as needed.

Hopefully some find this useful, it has been part of other code I have posted, but I came back across this thread and figured this should be hear for people who want to use it.
« Last Edit: August 10, 2023, 11:24:40 AM by cmwade77 »

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Examples of usage GRREAD - let's share
« Reply #273 on: August 16, 2023, 04:26:33 PM »
    Polar and Object Snap Tracking

    This is not perfect, but I have managed to make a routine that does polar and object snap tracking with GRREAD, there are a few limitations in this version:
    • Only intersection is working for object snap tracking, perpendicular is not yet included
    • OSNAP Tracking doesn't work if an entity is inside a view port and you are in paperspace.
    • Some of the graphical displays are not quite right, especially when working through a veiwport into modelspace
    • I have not figured out a way to mimic the extension osnap as of yet, that one may actually prove difficult from a performance standpoint though.
    • Snaps do not clear when hovering over them

    NOTE: This does utilize Lee Mac's GrSnap functions for the object snap portion, I wouldn't have been able to make this without his work.
    But amazingly there is no noticeable performance hit, please see the attached code and please let me know if you make changes. I am also quite sure that there are more efficient ways to do the code than I have, but this does work, again with the limitations above.

ETA: I found a bug when working with blocks, this version fixes these issues.
« Last Edit: August 21, 2023, 05:42:53 PM by cmwade77 »