Jump to content

Recommended Posts

Posted (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 by vvvraju007
place routines or code snippets between code tags
Posted

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

Posted

What is your goal of the routine , could you explain the action of your esteemed code ?

Posted

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

Posted

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")

Posted
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

Posted
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 ;)

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