Jump to content

Recommended Posts

Posted

Hi all.

I've been browsing various lsp web site but cannot find the lsp I need, help please.

As a surveyor, the final drawing I provide to clients normally has a number of tadpole symbols within it, at various rotation and scale (depending on the bank it's depicting).

 

Does anyone please know of a lsp that will insert the image below (either as a block or polyline) between two points on a dwg. The two points are not objects, just a click of the mouse. First click would be towards the top of the bank, and the second towards the bottom.

Scale would be uniform.

 

Any help would be massively appreciated.

 

Many thanks

 

image.thumb.png.a9666479c472edb462be24b24920194f.png

Posted

Here's a start:

(defun c:foo (/ a b c)
  ;; RJP » 2019-12-19
  (cond	((and (setq a (getpoint "\nSpecify first point: "))
	      (setq b (getpoint a "\nSpecify second point: "))
	 )
	 (cond ((null (tblobjname "block" "tadpole"))
		(entmake '((0 . "BLOCK")
			   (100 . "AcDbEntity")
			   (67 . 0)
			   (8 . "0")
			   (100 . "AcDbBlockReference")
			   (2 . "tadpole")
			   (10 0. 0. 0.)
			   (70 . 0)
			  )
		)
		(entmake '((0 . "LWPOLYLINE")
			   (100 . "AcDbEntity")
			   (67 . 0)
			   (8 . "0")
			   (100 . "AcDbPolyline")
			   (90 . 22)
			   (70 . 128)
			   (43 . 0.)
			   (38 . 0.)
			   (39 . 0.)
			   (10 -0.5 -0.114749297684967)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.5 0.114080025657987)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.454849456804684 -0.104934797692933)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.413421205288742 0.096437912142869)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.375929753505417 -0.087059886348453)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.341776901906013 0.082650999407604)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.308801743670404 -0.074110843303745)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.278352925930591 0.070503847370339)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.251040848554087 -0.063142172111403)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.225720643860097 0.059873680564679)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.201970675655275 -0.052351308020993)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.180968615974194 0.051240995428567)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.159966577622342 -0.045484401017021)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.142890162487252 0.042608300065427)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.124832325551051 -0.038028887666301)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.109718711359733 0.035348992239299)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.094408825605726 -0.032731553269879)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.081454283920863 0.031425045379888)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.069677435599793 -0.028022814993178)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 -0.058096880170641 0.027304892995883)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 0.077396192106708 0.00033463601349)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 0.5 0.00033463601349)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			  )
		)
		(entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0")))
	       )
	 )
	 (entmakex (list '(0 . "INSERT")
			 '(100 . "AcDbEntity")
			 '(8 . "Tadpole")
			 '(100 . "AcDbBlockReference")
			 '(2 . "Tadpole")
			 (cons 10 (polar a (angle a b) (/ (distance a b) 2.)))
			 (cons 41 (setq c (distance a b)))
			 (cons 42 c)
			 (cons 43 c)
			 (cons 50 (angle a b))
		   )
	 )
	)
  )
  (princ)
)

 

Posted

You should have searched this forum for "easy tadpoles", where I posted a very fundamental lisp which would provide you a starting point. (I have been using it for 30 years successfully)

 

One slight word of warning, your tadpole is quite complex, and when inserted at a small scale, it would make quite a splodge!

Posted

Here's a simpler 'tadpole' per @eldon comment about the complexity of the other.

(defun c:foo (/ a b c)
  ;; RJP » 2019-12-19
  (cond	((and (setq a (getpoint "\nSpecify first point: "))
	      (setq b (getpoint a "\nSpecify second point: "))
	 )
	 (cond ((null (tblobjname "block" "tadpole"))
		(entmake '((0 . "BLOCK")
			   (100 . "AcDbEntity")
			   (67 . 0)
			   (8 . "0")
			   (100 . "AcDbBlockReference")
			   (2 . "tadpole")
			   (10 0. 0. 0.)
			   (70 . 0)
			  )
		)
		(entmake '((0 . "LWPOLYLINE")
			   (100 . "AcDbEntity")
			   (67 . 0)
			   (8 . "0")
			   (100 . "AcDbPolyline")
			   (90 . 3)
			   (70 . 128)
			   (38 . 0.)
			   (39 . 0.)
			   (10 -0.5 -0.00033463601349)
			   (40 . 0.225)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 0.077396192106708 0.00033463601349)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			   (10 0.5 0.00033463601349)
			   (40 . 0.)
			   (41 . 0.)
			   (42 . 0.)
			   (91 . 0)
			  )
		)
		(entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0")))
	       )
	 )
	 (princ)
	 (entmakex (list '(0 . "INSERT")
			 '(100 . "AcDbEntity")
			 '(8 . "Tadpole")
			 '(100 . "AcDbBlockReference")
			 '(2 . "Tadpole")
			 (cons 10 (polar a (angle a b) (/ (distance a b) 2.)))
			 (cons 41 (setq c (distance a b)))
			 (cons 42 c)
			 (cons 43 c)
			 (cons 50 (angle a b))
		   )
	 )
	)
  )
  (princ)
)

 

Posted

Thanks so much for all the help guys.

Re. the 'splodge' comment, this is a good point so I thought if I spread it out a bit it'd go towards removing this issue.

The majority of my issued dwgs are at 1:200 scale so not a major issue.

I've run all the .lsp files above and I think the first one from ronjonp gives me exactly what I'm after, but thanks also to Eldon.

Ronjonp; is there any chance that you could please amend it to insert the symbol as per attached CAD file and on the SLOPE-SYMBOL layer. I can't pretend to know how you do it, or to read and fully understand the .lsp language, it's all smoke and mirrors to me... but thank you.

Slope Symbol.dwg

Posted

Whats wrong with this it autoscales between 2 plines. Add squiggles to tick.dwg.

 

image.thumb.png.e348c6763c8867e0a4584ba307bd2b58.png

Posted

Thanks for this BigAl, but my problem with this is that I need more freedom to individually place the slope symbols as I have to try to fit them inbetween the other detail I have on the dwg, so as to avoid overlapping. Example below. Ronjonp's .lsp alows me to do this. If possible I would just like his .lsp to create the symbol as per my last attachment. Hope that helps but everything I have had of you guys so far is really appreciated.

image.thumb.png.58c4a5e665dee93013f81212a9e49827.png

Posted

When you set up a drawing for use as a block to insert in a lisp programme, it is easier if you set the insertion point at 0,0 and the image scaled to a total length of one unit and aligned to zero degrees in your system. That way, the lisp does not have to do complicated mathematics to decide which way up and how big to insert the image. Then you should be able to pick the top point and then the bottom point, and the image is scaled and aligned as you want it.

 

I always like to pick where to put the tadpoles, and find it does not take all that much longer to hand place them, and it looks nicer too! For very long slopes, I explode the tadpole block, and extend the lower straight length.

tadpoles.PNG

Posted

That's a great tip re. extending the line on the bigger ones Eldon, and the dwg looks much better for it, thanks.

I've taken on everything in this thead and the 'easy tadpoles' thread and I now (after a bit of tinkering) have exactly what I was after.

You guys have been a fantastic help, thank you very much and MERRY CHRISTMAS...

  • 3 years later...
Posted

Hey everyone,

I did some minor changes to the routine so the tick name is changes and sits right next to the LSP file for easy management.

 

I've changed the text in the LSP so it selects the "Top of Batter" then "Bottom of Batter" though still got one problem...
When you select top of batter then bottom of batter the direction of the strings should be known but it isn't.(see image attached) 

 

I can reverse the strings for it to be correct though shouldn't have to do this. By selecting top and bottom strings it should know the direction.

Can someone please look at this and see what needs changing in the lisp to recognize the direction of strings based on top and bottom.

 

I've also amended the DWG to make the triangle smaller and feel it looks better.

 

Regards

 

image.png

batterticks.lsp battertick.dwg

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...