Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get results from "Boundry"

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
238 Views, 5 Replies

Get results from "Boundry"

Is it possible to get the Entity created when running the -boundary command with out using (entlast). My routine runs the boundary and asks user if boundary is correct if not, the boundary is erased. As it is now I am using (entlast) to get it, but if the user picks in an unclosed area Erase entlast is taking away something other than intended. Here is a snippet of what I'm doing... (while (setq qAreaPt (getpoint "\nPick a point:")) (command "-boundary" qAreaPt "") (setq qBndry (entlast)) (command "hatch" "S" qBndry "") (setq qHatch (entlast)) (setq qOK "Y") (prompt "\nYes, No, eXit") (setq uqOK (strcase (getstring (strcat "\nDoes hatch look correct? <" qOK ">: "))) ) (if (= uqOK "") (setq uqOK qOK) ) (cond ((= uqOK "X") (command "Erase" qhatch "") (command "Erase" qbndry "") ) Thanks in advance.... Dean
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

Switch to a temporary layer, and use (if (setq LST (ssget "x" '((0 . "LWPOLYLINE")(8 . ""))) (progn etc. ) ) -- Rudy@Cadentity.com AUTODESK Authorized Developer www.Cadentity.com MASi "Dean Kurth" wrote in message news:4050dafa_2@newsprd01... > Is it possible to get the Entity created when running the -boundary command > with out using (entlast). > My routine runs the boundary and asks user if boundary is correct if not, > the boundary is erased. > As it is now I am using (entlast) to get it, but if the user picks in an > unclosed area Erase entlast is taking away something other than intended. > Here is a snippet of what I'm doing... > > (while (setq qAreaPt (getpoint "\nPick a point:")) > (command "-boundary" qAreaPt "") > (setq qBndry (entlast)) > (command "hatch" "S" qBndry "") > (setq qHatch (entlast)) > (setq qOK "Y") > (prompt "\nYes, No, eXit") > (setq uqOK (strcase (getstring (strcat "\nDoes hatch look correct? <" > qOK ">: "))) > ) > (if (= uqOK "") > (setq uqOK qOK) > ) > (cond > ((= uqOK "X") > (command "Erase" qhatch "") > (command "Erase" qbndry "") > ) > > Thanks in advance.... > Dean > >
Message 3 of 6
Anonymous
in reply to: Anonymous

Now that was too fast on the draw....last not all and forgot a ')'. (if (setq LST (ssget "l" '((0 . "LWPOLYLINE")(8 . "")))) (progn etc. ) ) "Dean Kurth" wrote in message news:4050dafa_2@newsprd01... > Is it possible to get the Entity created when running the -boundary command > with out using (entlast). > My routine runs the boundary and asks user if boundary is correct if not, > the boundary is erased. > As it is now I am using (entlast) to get it, but if the user picks in an > unclosed area Erase entlast is taking away something other than intended. > Here is a snippet of what I'm doing... > > (while (setq qAreaPt (getpoint "\nPick a point:")) > (command "-boundary" qAreaPt "") > (setq qBndry (entlast)) > (command "hatch" "S" qBndry "") > (setq qHatch (entlast)) > (setq qOK "Y") > (prompt "\nYes, No, eXit") > (setq uqOK (strcase (getstring (strcat "\nDoes hatch look correct? <" > qOK ">: "))) > ) > (if (= uqOK "") > (setq uqOK qOK) > ) > (cond > ((= uqOK "X") > (command "Erase" qhatch "") > (command "Erase" qbndry "") > ) > > Thanks in advance.... > Dean > >
Message 4 of 6
Anonymous
in reply to: Anonymous

save the last entity before the user picks to a variable, after the pick compare the potentially new entlast to the saved variable, if they don't match, something new has been created. Dan -- ;;; For reply, change numbers to decimal "Dean Kurth" wrote in message news:4050dafa_2@newsprd01... > Is it possible to get the Entity created when running the -boundary command > with out using (entlast). > My routine runs the boundary and asks user if boundary is correct if not, > the boundary is erased. > As it is now I am using (entlast) to get it, but if the user picks in an > unclosed area Erase entlast is taking away something other than intended. > Here is a snippet of what I'm doing... > > (while (setq qAreaPt (getpoint "\nPick a point:")) > (command "-boundary" qAreaPt "") > (setq qBndry (entlast)) > (command "hatch" "S" qBndry "") > (setq qHatch (entlast)) > (setq qOK "Y") > (prompt "\nYes, No, eXit") > (setq uqOK (strcase (getstring (strcat "\nDoes hatch look correct? <" > qOK ">: "))) > ) > (if (= uqOK "") > (setq uqOK qOK) > ) > (cond > ((= uqOK "X") > (command "Erase" qhatch "") > (command "Erase" qbndry "") > ) > > Thanks in advance.... > Dean > >
Message 5 of 6
Anonymous
in reply to: Anonymous

Thanks, I'll give it a whirl... Dean
Message 6 of 6
H.vanZeeland
in reply to: Anonymous

or look at this modified

(while (setq qAreaPt (getpoint "\nPick a point:"))
(setq lEnt (entlast))
(command "-boundary" qAreaPt "")
(if (eq (entnext lEnt)(entlast))
(progn
(setq qBndry (entlast))
(setq lEnt (entlast))
(command "hatch" "S" qBndry "")
(if (eq (entnext lEnt)(entlast))(setq qHatch (entlast)))
(initget 6 "Yes No eXit")
(if (setq uqOK (getkword (strcat "\nDoes hatch look correct? No/eXit: ")))
(if (member uqOK '("eXit" "No"))(command "Erase" qhatch qbndry ""))))))

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost