Jump to content

LISP program that takes in 2 drawings and highlights any differences


Recommended Posts

Posted

A big part of my job is overlaying 2 construction drawings (usually 2 revisions, or 2 disciplines) and noting any significant differences, but this can be tedious and easily overlooked. Im looking to write a LISP that would take in 2 dxf's and compare the 2. The method would look something like:

  • open a drawing (or a new drawing)
  • run the tool
  • user is prompted to select a comparison drawing
  • all arc and line entities are compared
  • any matching entities (in length and position) are coloured dark grey 252
    • any non arc or line entities are also coloured grey
  • any entities from drawing A with no match are coloured red
  • and entities from drawing B with no match are coloured green
  • possiby draw a revision cloud around these? though this can get messy

and you might do something tricky with layers to highlight which drawing is which

 

My plan to compare drawings in LISP is:

  • import entities and prefix layers with file name (of do something tricky with blocks?)
  • explode all block refrences and polylines 
  • colour all entities 252
  • filter for lines and arcs of drawing 1 to sset1, and drawing 2 to sset2
  • iterate over each entity of sset1 (i) comparing to each entity of sset2 (j) using entget comparing in order:
    • type (line or acr)
    • length
    • start point
    • end point
  • if the entities do not match any of those critereia in that order, try j+1
  • if sset1(i) = sset2(j+1) then increase i+1, j=0
  • if sset1(i) is not found matching in sset2, then change colour to red, then increase i+1, j=0

 

Though this would work, it is pretty brute force, and is pretty common for supplied plans to have over 20,000 line entities, which may be likely to crash the program if you then have to do 20,000^2 comparisons

Any thought on how you would improve this? or increase the efficiency?

 

Posted

This is now built in to recent versions of Autocad I have not used so that's the end of my comments.

Posted
6 hours ago, BIGAL said:

This is now built in to recent versions of Autocad I have not used so that's the end of my comments.

 

built-in Bricscad too, but never tried it :)

 

 

  • 2 weeks later...
Posted

HELLO EVERYONE 

i like to bookmark this topic if is it possible in cadtutor bookmark favorite topic and if yes how we can do it??

Posted

 

11 hours ago, hosyn said:

HELLO EVERYONE 

i like to bookmark this topic if is it possible in cadtutor bookmark favorite topic and if yes how we can do it??

 

For CHROME & MS EDGE , you may try looking at the at upper right there's a small star ⭐ icon - add to favorite / bookmark

 

I've tested BCAD's DWGCOMPARE, quite easy, it highlight objects with different color!

 

compare.thumb.png.a58be8df3557d37a8aaab6390332a8a5.png

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