Jump to content

Recommended Posts

Posted

hi guys how r u all u r help lots, again i want u r help to creat some lisp for me i want lisp for to plot automatic co-ordinate

if i select pline or object lisp can give all "end points" or "mid points" co-ordinate in one time on dwg also lisp ask me for place ing of co-ordinat inside object or outside object .

try to u r best i attach a sample pdf

thanks

harshd

sample.pdf

sample2.pdf

Guest Alan Cullen
Posted

Ah, no help yet, gee, I dunno. give me a bit, I'll see if I can decifer your problem a little bit better. :D

Guest Alan Cullen
Posted

I'm real sorry, harshad, but the best I can do is give you a lisp that you have to pick the points and it will place the coord text beside the selected vertex.

 

But we do have some very excellent gurus, who I am sure will give you the program to help you.

 

In the meantime, if you want my lisp, just yell. :D o:)

Posted

There was a LISP posted on 21 Dec 2006 by ASMI, that dimensioned the X and Y (same as E & N) in one pick, and then another pick to place the text. :D

 

But I don't know how to go back far enough in the archive to give a reference - I only seem to be able to go back one year :cry:

 

 

P.S. It would help some members of the Forum if you could please type in full words and remember that this is not a mobile phone :wink:

Posted

> eldon

 

That is?

 

(defun c:ordi(/ fPt oldEcho dFlc dDec *error*) 

 (defun *error*(msg) 
     (setvar "CMDECHO" oldEcho) 
   (princ) 
   ); end of *error* 

 (princ(strcat "DIMSCALE="(rtos
		     (getvar "DIMSCALE"))" "
	"DIMLFAC="(rtos
		    (setq dFlc
		     (getvar "DIMLFAC")))" "
	"DIMDEC="(rtos
		   (setq dDec
		    (getvar "DIMDEC")))" "
 ); end strcat
); end princ	
 (setq oldEcho(getvar "CMDECHO")) 
 (setvar "CMDECHO" 0)
 (while t
 (if 
   (setq fPt(getpoint "\nSpecify point or Esc to Quit > ")) 
   (progn 
     (command "_.dimordinate" fPt "_t" 
         (strcat 
      "X=" (rtos(* dFlc(car fPt))2 dDec) 
      "\\X" 
      "Y=" (rtos(* dFlc(cadr fPt))2 dDec) 
      ); end strcat 
         pause 
         ); end command 
     ); end progn 
   ); end if
   ); end while
   (setvar "CMDECHO" oldEcho) 
 (princ) 
 ); end of c:ordi

 

> harshad

 

if i select pline or object lisp can give all "end points" or "mid points" co-ordinate in one time on dwg also lisp ask me for place ing of co-ordinat inside object or outside object .

 

It's possible... Maybe some programmer (good magician), want to have a hour (or two) training and write it for you. But today I have decided to drink some a few vodka (or much) with my friends and I say goodbye to you.

 

P. S. What for you have broken SHIFT key?

Guest Alan Cullen
Posted
P.S. It would help some members of the Forum if you could please type in full words and remember that this is not a mobile phone :wink:

 

Thank you, eldon. I wasn't game to say that, just that I had to re-read to try and understand.

 

Thanks, ASMI. PM coming your way.

Posted
> eldon

 

That is?

 

 

:thumbsup: Thank you for retrieving that routine ASMI, my copy was edited to suit me.

 

I am sure now that harshad will be able to do exactly as he wishes (with a little bit of editing) :D

 

Are you referring to my SHIFT key? I didn't know it was showing :oops:

 

(I spend too long typing, and Alan nips in ahead AGAIN!)

Posted

thanks for replay me asmi take u r time !! if its possible so good for me and others also

 

thanks

harshad

Posted

this lisp is given by fatty to me take and modify as i requred

thanks

harshad

LP3.LSP

  • 2 years later...
Posted

I know this thread is 2 years old but came upon it looking for the same answer. Your ordi.lsp routine is exactly what I need BUT I am having trouble getting it to display feet and inches. My dimstyle is set for feet and inches and they display when I use the dimordinate command. Do I have to edit the lsp routine? Anychance you could help a kid out?

Posted

You would have to edit the lisp yourself, but this is a good opportunity for you to look at the lisp and discover how it works.

 

The lisp grabs coordinates, but to write them on the screen, they have to be changed from real numbers to a string of text that can be written to the screen.

 

The lisp function that does that is 'rtos' and it also has facilities to change the mode of the units and the precision.

 

So you look through the code until you find something in that vein.

    "X=" (rtos(* dFlc(car fPt))[color="red"]2[/color] dDec) 
      "\\X" 
      "Y=" (rtos(* dFlc(cadr fPt))[color="red"]2[/color] dDec) 
      ); end strcat 

 

Then you should find out what the modes are:-

1. Scientific 1.55E+01

2. Decimal 15.50

3. Engineering 1'-3.50"

4. Architectural 1'-3 1/2"

5. Fractional 15 1/2

and you can see that the lisp is set for Decimal mode 2. You probably want mode 3 or 4, so just edit those numbers, and save it. :D

 

As always there are different ways of doing things, but this should give you a start.

Posted

Eldon's information is correct, and I would suggest you look over the code.

 

But I don't agree with how ASMI has coded the while loop, forcing the user to hit Esc.

 

(defun c:DimO ( / *error* ocm units prec fac p )
 (vl-load-com)
 ;; © Lee Mac 2010

 (defun *error* ( msg )
   (and ocm (setvar 'CMDECHO ocm))
   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
       (princ (strcat "\n** Error: " msg " **")))
   (princ)
 )

 (mapcar 'set '(fac units prec) (mapcar 'getvar '(DIMLFAC DIMLUNIT DIMDEC)))

 (setq ocm (getvar 'CMDECHO))
 (setvar 'CMDECHO 0)

 (while (setq p (getpoint "\nSpecify Point <Exit> : "))
   (command "_.dimordinate" "_non" p "_T"
     (strcat
       "X="    (rtos (* fac (car  p)) units prec)
       "\\XY=" (rtos (* fac (cadr p)) units prec)
     )
     pause
   )
 )

 (setvar 'CMDECHO ocm)
 (princ)
)

  • 8 months later...
Posted

Every time I think I have it all you have something hidden in the corner. This will save me half the time the way I was doing it. Thanks LEE

 

Eldon's information is correct, and I would suggest you look over the code.

 

But I don't agree with how ASMI has coded the while loop, forcing the user to hit Esc.

 

(defun c:DimO ( / *error* ocm units prec fac p )
 (vl-load-com)
 ;; © Lee Mac 2010

 (defun *error* ( msg )
   (and ocm (setvar 'CMDECHO ocm))
   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
       (princ (strcat "\n** Error: " msg " **")))
   (princ)
 )

 (mapcar 'set '(fac units prec) (mapcar 'getvar '(DIMLFAC DIMLUNIT DIMDEC)))

 (setq ocm (getvar 'CMDECHO))
 (setvar 'CMDECHO 0)

 (while (setq p (getpoint "\nSpecify Point <Exit> : "))
   (command "_.dimordinate" "_non" p "_T"
     (strcat
       "X="    (rtos (* fac (car  p)) units prec)
       "\\XY=" (rtos (* fac (cadr p)) units prec)
     )
     pause
   )
 )

 (setvar 'CMDECHO ocm)
 (princ)
)

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