vvvraju007 Posted March 6, 2012 Posted March 6, 2012 (edited) Hi I created small lisp program which find the polyline disconnected errors. its running correctly, but where polyline to polyline is disconnected distance is less than 0.1 its not placing error, Please clarify this. below is the program:- (Defun c:finddisconnection() (setq selrc (Ssget "x" '((8 . "RoadCentre_Line")(0 . "line,lwpolyline")) ) ) (setq sellen (sslength selrc)) (Setq selsub (- sellen 1)) (setq plusone -1) (while (< plusone selsub) (Setq plusone (+ plusone 1)) (setq rcent (ssname selrc plusone)) (Setq rccoo10 (vlax-curve-getstartpoint rcent)) (Setq rccoo11 (vlax-curve-getendpoint rcent)) (Setq sel10 (ssget "c" rccoo10 rccoo10)) (Setq sel11 (ssget "c" rccoo11 rccoo11)) (setq len10 (sslength sel10)) (Setq len11 (sslength sel11)) (cond ((<= len10 1)(command"circle" rccoo10 "3" "")) ) (cond ((<= len11 1)(command"circle" rccoo11 "3" "")) ) ) ) Please solve this.... thank u raj sample_file.dwg Edited March 8, 2012 by vvvraju007 place routines or code snippets between code tags Quote
MSasu Posted March 6, 2012 Posted March 6, 2012 Seems that you try to perform a crossing selection in each endpoint and validate if find one or two entities – why don’t simply compare the coordinates of those points? Check EQUAL function. May be useful to disable the OSMODE system variable when add those circle markers. Also, please add code brackets to your code excerpt. Regards, Mircea Quote
Tharwat Posted March 6, 2012 Posted March 6, 2012 What is your goal of the routine , could you explain the action of your esteemed code ? Quote
vvvraju007 Posted March 7, 2012 Author Posted March 7, 2012 Hi Mircea, Thanks for replay, I was new to lisp, I have understood the answer, but I am unable to create the program with coordinates. Note: There is another method to find the errors by “Network Topology “. But I have more data in dwg to go in this method. Thank u, Raj Quote
SLW210 Posted March 7, 2012 Posted March 7, 2012 vvvraju007, As pointed out by msasu, please read the CODE POSTING GUIDELINES and edit your post. Quote
Tharwat Posted March 7, 2012 Posted March 7, 2012 Mircea , you can use the "_non" instead of turning on and off the osmode every time you running the code . (command "_.circle" "_non" rccoo10 "3") Quote
MSasu Posted March 7, 2012 Posted March 7, 2012 Mircea , you can use the "_non" instead of turning on and off the osmode every time you running the code . That's true; but what if your rutine contains tens or hundreds of command calls? Regards, Mircea Quote
Tharwat Posted March 7, 2012 Posted March 7, 2012 That's true; but what if your rutine contains tens or hundreds of command calls? The best way is to deal with entmake(x) instead of command calls at any time Quote
Recommended Posts
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.