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

0 Members and 2 Guests are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: Examples of usage GRREAD - let's share
« Reply #255 on: August 25, 2014, 12:00:46 PM »
Cheers Ron  :-)

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Examples of usage GRREAD - let's share
« Reply #256 on: August 26, 2014, 04:41:55 AM »
Seeing that Lee has updated his "star" "rectangle" and "circle_tangents", I've changed my codes further more to be more user friendly with OSNAPs... One issue for Lee though "star" and "circle_tangents" can have ortho and polar modes - they aren't implemented, for "rectangle" IMHO I think it's not adequate... So here are my updates...

M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Examples of usage GRREAD - let's share
« Reply #257 on: August 26, 2014, 04:42:58 AM »
And golden spiral (helix)...

M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Examples of usage GRREAD - let's share
« Reply #258 on: August 26, 2014, 05:00:39 AM »
Just tested on A2014 and my "o" - osnap option doesn't work correctly, but on A2012 an lower versions it's just fine... Never mind, in A2014 - firstly set osnap combination and switch osnap with F3, or use single osnap with "e" - endpoint (for ex.) and so on...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Examples of usage GRREAD - let's share
« Reply #259 on: August 26, 2014, 12:04:54 PM »
Just tested on A2014 and my "o" - osnap option doesn't work correctly, but on A2012 an lower versions it's just fine... Never mind, in A2014 - firstly set osnap combination and switch osnap with F3, or use single osnap with "e" - endpoint (for ex.) and so on...

I figured out what was the problem with A2014... It was my setting of OSNAP Dynamic Input menu... Should have turned off both checks for Dynamic Prompt...

So it all works as expected...

Here is my version of Lee's "star"... Of course all credits to mr. Lee Mac (I only composed it differently and added my ortho and polar subfunctions)

Bye, M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Examples of usage GRREAD - let's share
« Reply #260 on: August 26, 2014, 01:09:55 PM »
My version of myrec.lsp...

For circle_tangents I am not in it fully...

Regards...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

77077

  • Guest
Re: Examples of usage GRREAD - let's share
« Reply #261 on: September 26, 2014, 08:53:55 AM »
Thanks marko! nice routine!

liuhaixin88

  • Guest
Re: Examples of usage GRREAD - let's share
« Reply #262 on: September 29, 2014, 04:14:43 AM »
Good routine of grread. I want to study.

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Examples of usage GRREAD - let's share
« Reply #263 on: November 05, 2015, 10:18:08 AM »
I know it's been while long ago when this was actual topic, but I wanted to share with you my new versions of Fibonuccie's golden spirals routines... Now I've tried to implement correctly tan and per OSNAP using my sub functions for obtaining list of points along curve from picked point in 3d space and I fairly did pretty well as you'll see if you check my lisps... I was using previous codes as starting point so Evgenyi's sub functions are there instead of Lee Mac's grsnap posted on his site... Still there are some issues you should avoid using this lisps :  avoid picking center point of circle and circle entity for searching per OSNAP as my sub function (per) implemented inside lisps may hang CAD; avoid picking collinear point and line entity to which start point is collinear for searching tan OSNAP as my sub function (tan) implemented inside lisps may hang CAD...

Related links with (per) and (tan) sub functions are posted here :

http://www.theswamp.org/index.php?topic=50398.msg555230#msg555230

http://www.theswamp.org/index.php?topic=50364.msg555229#msg555229

So I'll post here first 4 lisps and next I'll post my last 2 versions - Fibonuccie's golden spiral... I know this isn't so much useful routines, but I like them and I hope someone may improve them to be even better... Autodesk has built-in algorithm with real OSNAP implementation so commands like LINE and so on are using correct per and tan snapping, but I think my versions are also good as for starting point and may serve to help someone to visualize that built OSNAP implementation is possible and through AutoLisp...

I hope you'll like new versions like you did like old ones... I have them both in my library and they serve me very well...
Regards, M.R.
« Last Edit: November 05, 2015, 10:22:51 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Examples of usage GRREAD - let's share
« Reply #264 on: November 05, 2015, 10:21:07 AM »
And here is next 2 lisps - Fibonuccie's golden spirals...

M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

Jeff H

  • Needs a day job
  • Posts: 6144
Re: Examples of usage GRREAD - let's share
« Reply #265 on: November 06, 2015, 01:48:39 PM »

bilançikur

  • Newt
  • Posts: 82
Re: Examples of usage GRREAD - let's share
« Reply #266 on: November 07, 2015, 02:59:00 PM »
For greedy we are...

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Examples of usage GRREAD - let's share
« Reply #267 on: August 21, 2017, 02:09:40 PM »
Hi mr. Lee Mac, recently I've played again with your and Evgeniy's grsnap functions and I have good news... I discovered that you can relatively simply implement dialog box with OSNAPS inside routines that are using grread grsnap...

Basically, you have to implement (setq osm (getvar 'osmode)) line just when (while) loop starts, and then add inside (cond)
this line :
(cond
  ( (and (= (car gr) 11) (or (= (cadr gr) 1000) (= (cadr gr) 2000)))
    (vl-cmdf "'_+DSETTINGS" "2")
  )
  ...
)
This way you ensure that when (while (setq gr (grread t)) ... ) loop starts you have super useful option ctrl/shift + right mouse click for bringing OSNAP dialog box where you can interactively check options you want and then continue with grread functionality...

To show all this I'll attach my recent revisions of some (grread) grsnap routines that may be of interest for studying... There are also your 3pt rectangle, star example and ctan.lsp with my intervention... So basically no need for user input by keyboard, but those may be left as additional option for those who like it (parsing base point to relative point is also useful and may be left for sure...)
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

brandonSOUR

  • Mosquito
  • Posts: 3
Re: Examples of usage GRREAD - let's share
« Reply #268 on: January 11, 2018, 05:00:14 PM »
Hi All,

I would like to include my GRLEAD lisp to the list of already sterling examples.
I originally asked lee-mac for such a program and then being the cheap-o I am decided to jump in and try myself.
I use it to program a flow waterjet.
I add lead ins and traverse lines to polylines within AutoCAD then export a DXF.
I ensure that all blocks (parts) are completely comprised of polylines (including circles (c2p/p2c lisp)).
I then reference edit one part and have it update all the others in the nest.
Once I have done all my parts and all paths are connected via traverse (green) lines I explode everything to just have lines and arcs.
I export to DXF and then bring it into flow cut where all green turns into traverse entities and all color 150 entities turn into 50% cut quality entities.

I am sure you all could code this way better, but heres my simple lisp   :-D

Cheers,
Brandon

k4cadman

  • Mosquito
  • Posts: 2
Re: Examples of usage GRREAD - let's share
« Reply #269 on: July 09, 2021, 03:05:19 PM »
This is code from K4kube.lsp - a program I uploaded to various cad resources many years ago (2002?).
Plays Rubik's Cube game.
k4cube.lsp is referenced way back in this post,  but no code was posted (because it was obfuscated).
I have attached full source code for anyone to study, or to play!


      (setq pnt (grread))
      (setq prta (car pnt))
      (setq prtb (cadr pnt))

      (if (eq prta 3)
        (progn
          (setq faceno 0)
          (while (and (= facehit -1) (< faceno 27))
            (setq acen (nth (- 26 faceno) insets))
            (setq dist1 (distance acen prtb))
            (if (<= dist1 (* 0.12 nkscale))
              (setq facehit faceno)
              (setq faceno (1+ faceno))
            )
            (if (or (= facehit 2) (= facehit 16) (= facehit 19))
              (progn
                (setq facehit -1)
                (setq faceno 27)
              )
            )
          );while
         

prta = 3 if mouse clicked
prtb is the point clicked
Basically it determines which, if any, of the 27 visible faces of a Rubik's Cube has been hit.
Full source code attached