How to remove the unwanted entities, while converting PDF to Autocad

How to remove the unwanted entities, while converting PDF to Autocad

sarsivi30993
Advocate Advocate
1,021 Views
1 Reply
Message 1 of 2

How to remove the unwanted entities, while converting PDF to Autocad

sarsivi30993
Advocate
Advocate

Dear all,

 

How to remove the unwanted entities, while converting PDF to Autocad using Autocad software import option?

 

I have converted original PDF file to AutoCAD file using AutoCAD 2018 software (Using Import option) . I got the Autocad format file with the following issues.

 

The converted file contains lot of unwanted entities other than my converted pdf entities.

 

Kindly fix the above issues.

 

Requirement:

 

I have more than 2000 pdf files for Autocad conversion. If i work on each file, it consume more time to remove the unwanted entities. That is a time consuming process.

Is there any lisp / shortcuts methods available to avoid the above detailed issues.

 

I attached example images.

original pdforiginal pdfconverted file pdf 2 cadconverted file pdf 2 cad

Thanks in advance.

0 Likes
1,022 Views
1 Reply
Reply (1)
Message 2 of 2

ronjonp
Mentor
Mentor

If those are lines/plines perhaps a 'selectsimilar' command and compare total length/angle from a selected object.

Try this:

(defun c:foo (/ _a a e s)
  ;; RJP » 2018-11-26
  ;; Filter objects by length, angle and object name
  (defun _a (e / a b r)
    (list (rem (angle (vlax-curve-getstartpoint e) (vlax-curve-getendpoint e)) pi)
	  (vlax-curve-getdistatparam e (vlax-curve-getendparam e))
    )
  )
  (cond	((and (setq e (car (entsel "\nPick object to filter: ")))
	      (wcmatch (cdr (assoc 0 (entget e))) "ARC,LINE,*POLYLINE")
	      (setq a (_a e))
	      (setq s (ssget "_X" (list (assoc 0 (entget e)))))
	 )
	 (foreach x (mapcar 'cadr (ssnamex s)) (or (equal (_a x) a 1e-8) (ssdel x s)))
	 (sssetfirst nil s)
	)
  )
  (princ)
)
(vl-load-com)

2018-11-26_16-22-02.gif

0 Likes