Jump to content

Recommended Posts

Posted (edited)

Had written simple lisp which is inserting block and making ordinate dimension. Code:

 

(defun c:dorykota (/ scal scaletrjk H off  pt ptx pty ptmt curlay)
	(setq scal (getint "\nSet drawing scale: "))
(setq scaletrjk scal)
(setq off (* 1.3 scal))
(setq curlay (getvar "CLAYER"))
(setvar "CLAYER" "9 kreskowanie - szare") 
(while
(setq pt (getpoint "\select point"))
(setq ptx (car pt))
(setq pty (+ (cadr pt) off))
(setq ptmt (list ptx pty 0))
(princ ptmt)

(command "_.insert" "trójkąt wysokościowy zakresk" pt scaletrjk "" "0")
(command "_DIMORDINATE" pt "y" ptmt)
)
(setvar "CLAYER" curlay)
(princ)
)

 

The thing is that sometimes it makes dimension not in correct position. See picture:
image.thumb.png.4fdc07825d47d77fb1a5c201e870e415.png

 

Ok are good, other one, even same point clicked not. Don't know why. Could somebody check it? 

 

Edited by zwonko
Posted (edited)

@zwonko Try changing the following 2 lines to add "_non" right before the pt variable; this disables the object snaps so the point will be put exactly where the coordinates specify:

(command "_.insert" "trójkąt wysokościowy zakresk" "_non" pt scaletrjk "" "0"); <--- add "_non" before pt to disable osnaps
(command "_DIMORDINATE" "_non" pt "y" "_non" ptmt); <--- add "_non" before pt and ptmt to disable osnaps

 

P.S. if that is not working. I will need a sample drawing with that block in it to test.

Edited by pkenewell
  • Like 1
Posted

Work like a charm! Thank You! it was so annoying.

  • Like 1
Posted
6 hours ago, zwonko said:

Work like a charm! Thank You! it was so annoying.

Great! Glad it worked for you!

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