Jump to content

Highlight 2 overlapping blocks for visual verification


shailujp

Recommended Posts

I have two different blocks overlapped on each other which have similar or same geometries. I want to verify the visual difference on both the blocks. I want to verify if the vendor block contains the same geometry as mine.

 

Here is what I'm thinking and Need lisp for:

I want to select the first block, deselect it, select the other one, deselect it and then this process should be looped till I can visaully find difference between blocks by select/highlight method without grips. If possible to add timer between selection & deselection process would make things easier and allow zoom and pan while still looping.

 

Can anybody help me please?

Link to comment
Share on other sites

There is an app at the AutoDesk Exchange called Fast File Diff that will compare differences between two files. "Fast File Diff quickly creates a merged file with 3 colors: Magenta for differences in File 1 only, Cyan for differences in File 2 only, and Gray for the same in both. The differences between the two files are easily recognizable..."

 

· Advanced Options

o You can choose to ignore layer changes

o You can choose to ignore small objects

o You can choose to explode blocks or compare blocks

o Detects and displays paperspace differences

o Reports difference counts for each block/layout definition

o Too many to list all…

 

Maybe it's worth looking into. Just a suggestion.

Edited by ReMark
Link to comment
Share on other sites

Remark,

 

Thank you for your suggestion.

 

Do you think my request is a bit too much for AutoLISP? Just curious. And if so, what minimum can be done via LISP? I may opt out for Zoom,Pan and timer. As long as it shows flipping thru on the screen. I requested considering a lisp from Lee-mac for copyreplaceblock and in the end it keeps it selected/highlighted to be able to move the block.

Link to comment
Share on other sites

Sorry, but I do not have enough knowledge of lisp to say whether your request is attainable or not. I'll leave that to the lisp gurus to determine.

Link to comment
Share on other sites

So, here is my situation again !!! I joined this forum so that I can learn and gain more knowledge about AutoLISP. This is my second request on this forum (havent got any answer/solution on the first one yet) and I started thinking that I may be BLACKLISTED here since no one is responding to my request (Remark you are excluded :):).

 

Or, this is how this forum works? Doesnt look like it though based on what I see on other posts.

Link to comment
Share on other sites

That is one of the most illogical statements I've read in a long time.

 

First, your last post ( #5 ) title is insulting.

 

Second, you have not been blacklisted. Just because your thread has not drawn the number of responses you may have expected is no reason to think you have been shunned by the community.

 

Third, we are all volunteers, not paid staff, so we choose what threads we respond to, when we respond to them, and how we respond. Negative posts such as your last one will not serve to gain you any sympathy or support.

 

Fourth, it's summer for many of us and that means our participation at this site might be less than normal because we may be taking time off to relax and be with our families or go on vacation. That means fewer "eyes" on the questions posted here.

 

Until you show a little less attitude I doubt you'll receive any further assistance. However, in the spirit of at least trying to be helpful I suggest you either learn AutoLisp by visiting the sites mentioned in similar threads and/or go over to "The Swamp" and make inquires there.

 

By the way, what is this other request you refer to? Was it posted as a separate thread or did you hijack a thread by someone else?

 

And one last thing, the app I mentioned in post #2 does what you want (i.e. - compare blocks).

Link to comment
Share on other sites

Learning lisp. Start with these sites...

 

AfraLisp

http://www.afralisp.net/autolisp/tutorials/the-basics-part-1.php

 

AutoLisp Programming

http://ronleigh.com/autolisp/

 

AutoLisp Crash Course

http://www.cad-manager.com/wp-content/uploads/2007/11/cp105-2_the-autolisp-crash-course.pdf

 

AutoLisp Code

http://web2.airmail.net/terrycad/AutoLISP-Code.htm

 

CADSoft Solutions - Tutorials

http://www.caddsoftsolutions.com/AutoLISP.htm

 

Jeffrey Sanders - AutoLisp

http://www.jefferypsanders.com/index.html

 

Lee Mac Programming

http://lee-mac.com/

 

The Swamp

http://www.theswamp.org/index.php

Edited by ReMark
  • Thanks 1
Link to comment
Share on other sites

Remark,

 

I did not meant to be insulting anybody here. If I did so, I'm sorry. That was purely unintentional and not showing any kind of attitude atleast in my perspective. This is what I wrote based on 'waiting waiting waiting' and then finaly felt "its not working".

 

By the way, I'm already using Afralisp and Jeffery Sanders' website for the learning purpose.

 

My other thread is this. It was my mistake not to initiate the new thread and like you said I hijacked into someone's thread.

http://www.cadtutor.net/forum/showthread.php?63323-LISP-for-point-export&p=549383#post549383

Link to comment
Share on other sites

Forum members cannot be coerced into looking at threads. Good things do however come to those that show some patience and wait.

 

Apology accepted. Let's move on.

 

I gave you one option (the app). Are you willing to try it?

 

I'll look at the other thread but if it is another question regarding lisp I will be of little help to you.

 

Note to mods. Perhaps the question by shailujp and the subsequent responses can be extracted from the above referenced thread and posted as a separate thread? Thank you.

Link to comment
Share on other sites

Really? It's $10 (U.S.).

 

Are you working for a company or are you self employed?

 

You do realize the amount of work that goes into writing something like this don't you? What would you be willing to pay to have a custom lisp program written?

Link to comment
Share on other sites

Why not xref-in the second block and put in on color blue or color 251 and your block in the current drawing to color yellow or magenta. So you can visually see the difference rather than flipping between 2 drawings.

Untitled.jpg

Link to comment
Share on other sites

I want to select the first block, deselect it, select the other one, deselect it and then this process should be looped till I can visaully find difference between blocks by select/highlight method without grips. If possible to add timer between selection & deselection process would make things easier and allow zoom and pan while still looping.

 

Here is a very simple program to try:

(defun c:compare ( / cmd en1 en2 int )
   (if
       (and
           (setq en1 (car (entsel "\nSelect 1st object: ")))
           (setq en2 (car (entsel "\nSelect 2nd object: ")))
       )
       (progn
           (setq int 1 cmd (getvar 'cmdecho))
           (setvar 'cmdecho 0)
           (princ "\nPress any key to exit...")
           (while
               (and
                   (not (vl-catch-all-error-p (setq grr (vl-catch-all-apply 'grread '(t ))))
                   (= 5 (car grr))
               )
               (redraw en1 int)
               (redraw en2 (setq int (- 3 int)))
               (command "_.delay" 100) ;; Flicker rate
           )
           (setvar 'cmdecho cmd)
           (redraw en1 1)
           (redraw en2 1)
       )
   )
   (princ)
)

Link to comment
Share on other sites

Lee,

 

Wow, this does exactly what I described. I see you have the delay timer as well. Absolutely fantastic.

 

The only thing I noticed is while running this LISP, when I press Esc instead of `Press any key to exit...' I lost one of the block. But this works great as is.

 

Many salutes.

Link to comment
Share on other sites

Why not xref-in the second block and put in on color blue or color 251 and your block in the current drawing to color yellow or magenta. So you can visually see the difference rather than flipping between 2 drawings.

 

jdiala,

If the entities are overlapping and if the color is also same (and the block is huge in terms of length), its not possible to be very sure to make out the difference between blocks.

Link to comment
Share on other sites

The only thing I noticed is while running this LISP, when I press Esc instead of `Press any key to exit...' I lost one of the block. But this works great as is.

 

This should fix that issue:

(defun c:compare ( / *error* cmd en1 en2 int )

   (defun *error* ( msg )
       (if (= 'ename (type en1)) (redraw en1 1))
       (if (= 'ename (type en2)) (redraw en2 1))
       (if (= 'int   (type cmd)) (setvar 'cmdecho cmd))
       (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))
           (princ (strcat "\nError: " msg))
       )
       (princ)
   )
   
   (if
       (and
           (setq en1 (car (entsel "\nSelect 1st object: ")))
           (setq en2 (car (entsel "\nSelect 2nd object: ")))
       )
       (progn
           (setq int 1 cmd (getvar 'cmdecho))
           (setvar 'cmdecho 0)
           (princ "\nPress any key to exit...")
           (while
               (and
                   (not (vl-catch-all-error-p (setq grr (vl-catch-all-apply 'grread '(t ))))
                   (= 5 (car grr))
               )
               (redraw en1 int)
               (redraw en2 (setq int (- 3 int)))
               (command "_.delay" 100) ;; Flicker rate
           )
           (setvar 'cmdecho cmd)
           (redraw en1 1)
           (redraw en2 1)
       )
   )
   (princ)
)

 

You're welcome!

Link to comment
Share on other sites

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