Jump to content

Recommended Posts

Posted

Please help with lisp. I'm looking for an offset or a copy lsp that can offset an object, and I can highlight all the text and ignore the "+". Thank you in advance.

Posted (edited)
4 hours ago, Jojo said:

Please help with lisp. I'm looking for an offset or a copy lsp that can offset an object, and I can highlight all the text and ignore the "+". Thank you in advance.

The previous lsp I had is when I offset it... It makes if bigger or smaller because its an offset, so what I'm actually doing is to copy an object (copy command) and type the distance which is a lot of typo due to typing all the numbers. any help would be greatly appreciated. thank you

Sample2.dwgSample2.dwgSample2.dwgSample2.dwgSample2.dwg

Edited by Jojo
Posted

Hello again. I'm using Carlson software, and I attached a dwg for sample.

Posted

'...highlight all the text and ignore the "+"....' ?
Can you clarify that?

Posted

This is a long section sample but with no line work etc, doesn't the Carlson software do what you want, if not maybe CIV3D or Civil Site Design as an alternative. 

Posted
13 hours ago, BIGAL said:

This is a long section sample but with no line work etc, doesn't the Carlson software do what you want, if not maybe CIV3D or Civil Site Design as an alternative. 

Hi Bigal. Carlson doesn't do what I want it to do, and I don't have Civil 3D.

Posted
14 hours ago, GLAVCVS said:

'...highlight all the text and ignore the "+"....' ?
Can you clarify that?

 GLAVCVS. I was hoping to find lsp that can copy this object, and I can just highlight all the text and move it to all these different distances and will ignore the "+" sign, or just dont worry about the "+". Thank you.

 

Posted (edited)

@Jojo

 

Try this:

 

(prompt "\nTo run LISP type: MCODIST")

(defun c:MCODIST ( / old_copyMode old_osmode copyEntity basePoint side sign old_nomutt ss len i data position_+ stringOne stringTwo stringConcate)
  (setq old_copyMode (getvar 'copymode)
	old_osmode (getvar 'osmode)
	)
  (setvar 'copymode 1)
  (setq copyEntity (car (entsel "\nPick the copy entity:"))
	basePoint (getpoint "\nPick the base point:")
	)
  (initget 1 "Left Right")
  (setq side (getkword "\nChoose side for copy [Left/Right]:"))
  (if (= side "Left")
    (setq sign -)
    (setq sign +)
    )
  (setq old_nomutt (getvar 'nomutt))
  (setvar 'nomutt 1)
  (princ "Select all Text entities:")
  (setq ss (ssget '((0 . "*TEXT")))
	len (sslength ss)
	i 0
	)
  (setvar 'nomutt old_nomutt)
  (setvar 'osmode 0)
  (while (< i len)
    (setq data (cdr (assoc 1 (entget (ssname ss i))))
	  position_+ (vl-string-position (ascii "+") data)
	  )
    (if (/= position_+ nil)
      (progn
	(setq stringOne (substr data 1 position_+)
	      stringTwo (substr data (+ position_+ 2) (strlen data))
	      stringConcate (strcat stringOne stringTwo)
	      )
	(command-s "_copy" copyEntity "" basePoint (list (sign (car basePoint) (atof stringConcate)) (cadr basePoint) (caddr basePoint)))
	)
      )
    (setq i (1+ i))
    )
  (setvar 'copymode old_copyMode)
  (setvar 'osmode old_osmode)
  (prompt (strcat "\nThe entity was copied " (itoa len) " times!"))
  (princ)
  )

 

Best regards.

Edited by Saxlle
Something weird with video upload

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