Compare Plans and table value

Compare Plans and table value

marlance
Advocate Advocate
1,286 Views
14 Replies
Message 1 of 15

Compare Plans and table value

marlance
Advocate
Advocate

I want to compare the values of plans and table (exploded). Those that are not matching will be marked with polyline by selecting the Point ID.

 

 

see attached file and screenshot below 

 

 

 

select.pngafter.PNG

 

 

0 Likes
1,287 Views
14 Replies
Replies (14)
Message 2 of 15

dlanorh
Advisor
Advisor
It would be a lot easier if the table wasn't exploded, Is that possible?

I am not one of the robots you're looking for

0 Likes
Message 3 of 15

pbejse
Mentor
Mentor

@dlanorh wrote:
It would be a lot easier if the table wasn't exploded, Is that possible?

 

Indeed, but the OP's clear on the table is already exploded

 


@marlance wrote:

I want to compare the values of plans and table (exploded). Those that are not matching will be marked with polyline by selecting the Point ID.

 


 

 You're happy with just showing what is not matching? what about Marked AND change ?

 

 

 

 

 

0 Likes
Message 4 of 15

dlanorh
Advisor
Advisor

@pbejse wrote:

@dlanorh wrote:
It would be a lot easier if the table wasn't exploded, Is that possible?

 

Indeed, but the OP's clear on the table is already exploded


 

I saw that but wondered if the OP had exploded the table in search of a solution. Hence the question.

 

 

 

 

 

I am not one of the robots you're looking for

0 Likes
Message 5 of 15

pbejse
Mentor
Mentor

@dlanorh wrote:

@pbejse wrote:

@dlanorh wrote:
It would be a lot easier if the table wasn't exploded, Is that possible?

 

Indeed, but the OP's clear on the table is already exploded


 

I saw that but wondered if the OP had exploded the table in search of a solution. Hence the question.

 

 

 

 

 


 

Fair enough, this is probably one of those cases i guess.

 

 

0 Likes
Message 6 of 15

marlance
Advocate
Advocate

My apology.

I accidentally hit the accept solution button.

 

BTW, I explode the table co'z I am working with thousands of points. 


@pbejse wrote:

@dlanorh wrote:

@pbejse wrote:

@dlanorh wrote:
It would be a lot easier if the table wasn't exploded, Is that possible?

 

Indeed, but the OP's clear on the table is already exploded


 

I saw that but wondered if the OP had exploded the table in search of a solution. Hence the question.

 

 

 

 

 


 

Fair enough, this is probably one of those cases i guess.

 

 


 

0 Likes
Message 7 of 15

pbejse
Mentor
Mentor

No worries buddy.

 

We'll have something for you later, by the way any chance you still have drawing with tables that were not exploded? 

 

0 Likes
Message 8 of 15

marlance
Advocate
Advocate

@pbejse wrote:

No worries buddy.

 

We'll have something for you later, by the way any chance you still have drawing with tables that were not exploded? 

 


See attached file @pbejse 

 

Thank you

0 Likes
Message 9 of 15

pbejse
Mentor
Mentor

There you go 

 

0 Likes
Message 10 of 15

pbejse
Mentor
Mentor

@marlance  

Since you do have a non-exploded table, do you still require a code for the exploded one?

 

0 Likes
Message 11 of 15

marlance
Advocate
Advocate
i prefer exploded table for thousand points .
0 Likes
Message 12 of 15

pbejse
Mentor
Mentor

@marlance wrote:
i prefer exploded table for thousand points .

 

I guess we can do both, it's just a matter of changing the selection filter. I'll write the code for the UN-exploded table first.

 

As I started working on this today,  I came across DXF 110 on MLeader Context Data Group Codes. and on the OP's sample drawing, that value is the same as the insertion point of the block it's referring to. I use that for now as the reference value for EASTING and NORTHING value for comparison. Not sure if its the same for all or most of the 1000 points on the actual drawing.

 

Can you anyone explain 110 for me before I proceed with the building the code.

 

 

 

 

 

 

0 Likes
Message 13 of 15

marlance
Advocate
Advocate
hi pbejse
you can skip the checking for x and y coordinates.
0 Likes
Message 14 of 15

pbejse
Mentor
Mentor

@marlance wrote:
hi pbejse
you can skip the checking for x and y coordinates.

 

On this forum, you will get what you asked for marlance.

Pity I can only test this on your sample drawing, which only has a few objects to compare.

 

There is still a lot of work to do to make it run smoother. Like flag the objects not shown on the table, etc...

This version is for UN-Exploded table.

 

Command: ThistablesisNOTexploded

Select Table
Select Blocks & label

 

 

0 Likes
Message 15 of 15

pbejse
Mentor
Mentor

 


@pbejse wrote:

On this forum, you will get what you asked for marlance...

..

Command: ThistablesisNOTexploded

Select Table....

Wonder what happened to this request. The code I posted was meant to be funny ( no one is laughing :O, apparently not ), it is a literal solution based on the posted sample drawing.  I had fun writing the code though.

 

 

Screencast will be displayed here after you click Post.

27c0bf98-a859-4951-97e8-226c197b7180

 

 

In any case, I'm posting another one that updating the "table"   values and changing the color (could be commented if needed ). This time the table is exploded.

 

;;;	pBe Feb2019 | Compare Plans and table value | Autodesk Forum				;;;

(defun c:whyisthetablesexploded ( / Near2point _Makeit5 Mtxt_Table ML_Collected _dxf _rtos _TheValues)

;;;;												;;;

  (Defun Near2point  (pt pts / p B e)
  (setq e (list pt 1e12))  
      (while (setq p (car pts))
            (if (<  (setq B (distance pt p)) (cadr e) )
                  	(setq e (list p B)))
	 
            (setq pts (cdr pts)))
      (car e))
  
  (defun _Makeit5 (l)
  (if l
    (cons
      (list
        (car l) (Cadr l) (caddr l)
        (cadddr l) (cadddr (cdr l)) )
      		(_Makeit5 (cddddr (cdr l)))
      )
    )
  )

  (defun _TheValues (str / p)
	  (if (setq p (vl-string-search "\\P" str))
	    (cons (substr str 1 p) (_TheValues (substr str (+ 3 p))))
	    (reverse (cons str l))
	  )
	)

  (setq _Num (lambda  (str)
	  	(vl-some '(lambda (s)
			    (if (vl-string-search s str)
			      		(vl-string-subst "" s str)))
			 	'("EG=" "FG="))
  				)
      			)
  
;;;;												;;;
  

(setq Mtxt_Table nil ML_Collect nil BL_Collect nil)  
(setq _dxf (lambda (d)(cdr (assoc d ent))))
(setq _rtos (lambda (n)(rtos n 2 3)))   

  (if
    (and
      	(princ "\nSelect Table")
	(setq Table (ssget '((0 . "MTEXT") (1 . "P##*#,#*#")))) 
	(princ "\nSelect Blocks & label")
	(setq Blks&ML (ssget '((-4 . "<OR")
                            	(-4 . "<AND")(0 . "INSERT")(2 . "PNT")(-4 . "AND>")
				(0 . "MULTILEADER")
					 (-4 . "OR>"))))
	)
    
    (progn
      (repeat (setq i (sslength Table))
		(setq e (ssname Table (setq i (1- i))) ent (entget e))
        	(setq Mtxt_Table (cons (list (_dxf 10)(_dxf 1) e) Mtxt_Table))		      
        )
      
      	(repeat (setq i (sslength Blks&ML))
		(setq e (ssname Blks&ML (setq i (1- i))) ent (entget e) otype (_dxf 0))      
		      (cond
			(	(eq otype "MULTILEADER")
		         	(setq ML_Collect (Cons (list (_dxf 110) e) ML_Collect))	
						)
		        (	(eq otype "INSERT")
		         	(setq BL_Collect (Cons (_dxf 10) BL_Collect))
		         			)
		        )
        )
        	
	(setq Mtxt_Table
           (mapcar 'cdr 
	           (vl-sort  Mtxt_Table
	             '(lambda (a b)
		                (cond
		                  ((> (cadar a) (cadar b)) T)
		                  ((equal (cadar a) (cadar b) 0.1)
		                   (< (caar a) (caar b))
		                   )
		                  )
		                )
		             )
             		)
	          )
      	
      (and
      	(= (length ML_Collect)(length BL_Collect))
      	(foreach p_ ML_Collect
		  	(setq ML_Collect (subst
			       (list (Near2point (Car p_) BL_Collect) (cadr p_)) p_ ML_Collect))
		  )

      	(setq ML_Collected
	       (mapcar '(lambda (itm)
			(Setq ip  (mapcar '_rtos (Car itm)) ent (entget (Cadr itm)))
			(setq EG:PG (_TheValues (_dxf 304)))
				(list
					(car EG:PG) (_Num (cadr  EG:PG))(_Num (caddr EG:PG))
					       (car ip)(cadr ip))
                          ) 	ML_Collect)
		     )
            
	(foreach info (_makeit5 Mtxt_Table)
	  	(setq string_info (mapcar 'car info))
		(if (setq f (vl-some '(lambda (d)				    
					    (if	(and
						  (equal (car d) (Car string_info))
						  (not (equal d string_info))
						)
					      d
					    )
					  )
				    ML_Collected
				)
			    )
			  (progn
			    	(setq ML_Collected (vl-remove f ML_Collected))
	                            	(mapcar '(lambda ( u v)
	                                           	(if (not (eq (car u) V))
                                                          (progn
                                                            (Vla-put-color (vlax-ename->vla-object (Cadr u)) 2)
	                                                  	(vla-put-textstring
                                                                  (vlax-ename->vla-object (Cadr u)) v)))
                                                   )
	                            		(Cdr info )(cdr f)
							)
						)
					)
				)
			);and
		      );progn
		    );if
		(princ)
	);defun

(vl-load-com)

HTH

0 Likes