Jump to content

Place attributed blocks along lwpolyline length with Tharwat "CATCH PIT" lisp


Cezar Barbalho

Recommended Posts

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • Cezar Barbalho

    14

  • Tharwat

    12

  • Lee Mac

    2

Top Posters In This Topic

Posted Images

Hi Tharwat,

 

it's working, but i have found a limitation on the polyline length, if i try to use a polyline longer than 100 kilometers, it freezes the program.

This issue is something easy to work around?

 

Hi Cezar,

 

I just modified the program HERE so please try it again and let me know.

Link to comment
Share on other sites

Hi Tharwat,

 

I have just tested it again and it does work on a 100 KM or + swpolyline! You have been of great help to me.

On this last saturday i have been working on this project and decided to supress one of the attributes, and to put some fomating on the output text, it has worked as expected, i'll post the modifications i have done to the code so you can tell me what you think of it.

I understand that the original request was for 3 attributes, not 2. But this was all i could do to work around my issue.

Thanks again for your help and pacience.

 

(SETQ km	(COND
			  ((= (SETQ lng (LENGTH (VL-STRING->LIST (RTOS d 2 0))))
			      1
			   )
			   (STRCAT "000+00" (SUBSTR (RTOS d 2 0) 1 1))
			  )
			  ((= lng 2) (STRCAT "000+0" (SUBSTR (RTOS d 2 0) 1 2)))
			  ((= lng 3) (STRCAT "000+" (SUBSTR (RTOS d 2 0) 1 3)))
			  ((= lng 4)
			   (STRCAT "00"
				   (SUBSTR (RTOS d 2 0) 1 1)
				   "+"
				   (SUBSTR (RTOS d 2 0) 2 3)
			   )
			  )
			  ((= lng 5)
			   (STRCAT "0"
				   (SUBSTR (RTOS d 2 0) 1 2)
				   "+"
				   (SUBSTR (RTOS d 2 0) 3 3)
			   )
			  )
			  ((= lng 6)
			   (STRCAT (SUBSTR (RTOS d 2 0) 1 3)
				   "+"
				   (SUBSTR (RTOS d 2 0) 4 3)
			   )
			  )
			) 

Link to comment
Share on other sites

You are most welcome Cezar,

 

You can shorten your codes with the following codes. ;)

 

(setq d (rtos d 2 0)
     l "")
(repeat (- 6 (strlen d)) (setq l (strcat l "0")))
(strcat (substr (strcat l d) 1 3) "+" (substr (strcat l d) 4 3))

Link to comment
Share on other sites

Hi Tharwat and Lee Mac,

 

I really liked yours suggestions, i am learning a lot from you Tharwat. And Lee Mac, i am a fan of your work too, it was your site that make me want to learn to do lisp, and it was Tharwat lisp code that answered my needs on my job. Thank you guys!

Link to comment
Share on other sites

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...