Jump to content

Recommended Posts

Posted

What is the gideline for creating this routine

 

What is lisp command to add dimension

 

Thanks

Dim.png

Posted

You can start with a simple LISP that makes use of the ACAD commands.

(defun c:test(/ p1 p2 p3 p4 p5)
 (setq p1 (getpoint "\nPick Center point."))
 (setq p2 (getpoint "\nPick Corner point."))
 (setq p3 (list (max (car p1)(car p2))(max (cadr p1)(cadr p2))))
 (setq p4 (list (min (car p1)(car p2))(max (cadr p1)(cadr p2))))
 (setq p5 (list (min (car p1)(car p2))(min (cadr p1)(cadr p2))))
 (setq p6 (list (- (min (car p3)(car p4)) 400)(+ 400 (max (cadr p4)(cadr p5)))))
 (command "_.dimlinear" "_non" p3 "_non" p4 "_non" (polar p3 (/ pi 2.) 400) )
 (command "_.dimlinear" "_non" p4 "_non" p5 "_non" (polar p5 pi 400) )
 (entmakex (list (cons 0 "TEXT") ;*** 
                 (cons 1 "My Text") ;* the string
                 (cons 40 (getvar "textsize")) ;* Text height
                 (cons 10 p6)))
 (princ)
)

Posted

Thanx CAB

There is another idea to pick a point inside rec (or any shape) then pick a point outside and using IF to run one of four cases showen

the point is how to how to compare between the 2 points to deside which case will be run.

this is my idea to create a Pline using -boundary command then find max X and Y for vertexs of the Pline

 

then complete the routine

 

(defun c:tst2 ()

(setq p1 (getpoint "\nPick point inside: "))

(setq p2 (getpoint "\nPick point outside: "))

(Command "-boundary" "p1" "")

 

but i halted at this point to create the boundary

the command does not accept p1

 

Is this way correct or there is better way?

Dim-02.png

Posted

A possible example of what you are looking for:

http://web2.airmail.net/terrycad/LISP/DPL.lsp

Posted

:? It is great Routine but I do not know how to go through and get the point what I am looking for.

 

I am new, It is my first step in lisp.

Posted

What's the difference of "entmake" and "entmakex" ?

Posted
What's the difference of "entmake" and "entmakex" ?

 

entmakex will return the newly created entity name - check it in the Visual LISP Editor Help file :)

Posted

whats wrong with this

(Command "-boundary" "p1" "")

does not accept p1

this error

2D point or option keyword required.
Posted
(Command "-boundary" [b]"[/b]p1[b]"[/b] "") 

First thought is

(Command "-boundary" p1 "") 

Posted

Yes anything in quotes is a string and the command is looking for a point list.

 

Another option:

(command ".boundary" "A" "I" "Y" "O" "P" "" p1 "")

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