How to read data from PDF in AutoCAD

How to read data from PDF in AutoCAD

SaddamShaikh77
Advocate Advocate
2,838 Views
9 Replies
Message 1 of 10

How to read data from PDF in AutoCAD

SaddamShaikh77
Advocate
Advocate

I have pdf in which there are multiple pages and it contains information about trusses and some text.
I have to retrieve geometry data from selecting the truss area from selecting a particular page and export it to the json to create the same truss in the Revit.

Please find the attached screenshot of the pdf page.(I have to get data from marked in yellow)

Kindly guide me on how to achieve this.

0 Likes
2,839 Views
9 Replies
Replies (9)
Message 2 of 10

vinodkl
Mentor
Mentor

Hi,

 

If you want the geometry in PDF then you can import the PDF into AutoCAD using the command "PDFIMPORT" (available on AutoCAD 2017 and above)

--------------------------------------------------------------------------------------------------------------------------
ವಿನೋದ್ ಕೆ ಎಲ್( System Design Engineer)
Likes is much appreciated if the information I have shared is helpful to you and/or others.

Please mark "Accept as Solution" if my reply resolves the issue or answers your question, to help others in the community.
--------------------------------------------------------------------------------------------------------------------------
0 Likes
Message 3 of 10

SaddamShaikh77
Advocate
Advocate

Hello and Thank you.

I have imported the pdf and now want to know how to extract the specific geometry shown in the yellow region in the attached image, excluding the rest text and other data.

 

0 Likes
Message 4 of 10

ennujozlagam
Mentor
Mentor

once you PDFIMPORT you can select the file to extract.  you can only extract by page. thanks

 

pdm.JPG





Remember : without the difficult times in your LIFE, you wouldn't be who you are today. Be grateful for the good and the bad. ANGER doesn't solve anything. It builds nothing, but it can destroy everything...
Please mark this response as "Accept as Solution" if it answers your question. Kudos gladly accepted.
0 Likes
Message 5 of 10

SaddamShaikh77
Advocate
Advocate

Thanks.
Let me clearly ask, I need help at API level. How to extract the  geometry data from pdf using AutoCAD api.
Is there any codes available. I have searched but didn't get any.
Do I need to implement my own logic or do I need to go with any third-party tool.

0 Likes
Message 6 of 10

dbroad
Mentor
Mentor

No. AFAIK, there is no API for conversion to DWG.  Even if there was, there wouldn't be any way for the program to determine automatically what areas to import.  In addition, the PDF will be to an arbitrary scale.  The dimension strings around the truss and the descriptions of the truss members themselves have enough information to recreate the truss.  For output programs that create relatively correct dimensions, those dimensions must be used to scale the pdf before converting it.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 7 of 10

SaddamShaikh77
Advocate
Advocate

I can either PDFIMPORT or PDFATTACH and manually can convert to dwg.
Using PDFIMPOPRT I am getting pdf as dwg but when I am using PDFATTACH I have to do some manual process.
I am trying to find a way for selecting multiple pages and converting them to dwg .
Or could you please tell me how to export the trusse's geometry from pdf using AutoCAD to Json for recreation to Revit.

 

Thanks.

0 Likes
Message 8 of 10

dbroad
Mentor
Mentor

You seem to be asking multiple questions.  It is clear that you want to turn the printed information from the truss manufacturer into something that could be used inside Revit.  It is somewhat unclear what you need to import into the drawing (vector geometry, text information, or just image data) and what kind of Revit geometry you are creating (generic model, analytic truss, detail component, etc., or drafting view).  It seems like you may want to use Dynamo to recreate the truss given the truss information using json data structures. I would be very interested in how you expect to do that reliably even from a single page. <aside>I've had very poor results integrating any truss elements as analytical trusses on my projects and now use detail components to make section and callout views look realistic rather than dorky rectangular assemblies.</aside>

 

The most obvious question that I can answer is "Can I import more than one page at a time into AutoCAD?". You can customize with LISP to batch either the -pdfattach or -pdfimport commands, not PDFATTACH OR PDFIMPORT.  If you use -pdfimport, the geometry can be imported and converted at the same time.  If you use -pdfattach, you would need to follow up with -pdfimport to convert.  <aside> Why you want all the trusses printouts to go in the same drawing is a bit of a mystery.</aside> The -pdfimport command could be used within a LISP to place any number of sheets from a file and to convert them, making it appear to be a one step operation.  <aside>I often batch import multiple pdf pages into a single drawing for specs and code compliance sheets like Appendix B.  My process is Word document->PDF ->AutoCAD.  I plot the AutoCAD sheets and merge them with the Revit sheets.</aside>

 

You still have the problems I discussed before. The geometry will not be at a consistent scale or may be not to scale at all.  Also, the imported text (dimensions and notes)  may be text after importation but will probably be merely lines, which can't be programmatically interpreted.

 

Good luck. I'd be very interested in learning the process of converting vector data into Revit trusses.

Architect, Registered NC, VA, SC, & GA.
Message 9 of 10

SaddamShaikh77
Advocate
Advocate

Thanks man.
Now my doubt is clear and you gave me clue for pdfimport and pdfattach. I will follow one of your approach running -PDFIMPORT in batch and that should work, I guess.
I want to transfer vector data ,some limited texts and there values to Revit . I want to create outer profile of the Truss in Revit, as this is the requirement.
Now I am curious to work while extracting the data from pdf. How to get outer geometry from the existing truss , excluding all inner details and dimensions.
If you have any thoughts or any code level help in extracting the geometry from the imported truss.

Thanks a lot.

 

 

 

0 Likes
Message 10 of 10

dbroad
Mentor
Mentor

@SaddamShaikh77 wrote:

I want to create outer profile of the Truss in Revit, as this is the requirement.

 

Now I am curious to work while extracting the data from pdf. How to get outer geometry from the existing truss , excluding all inner details and dimensions.

No idea how to automate that.  Unless you have an AI smart enough to replace a drafter, there's a lot of manual work to select, layer, and scale what you want to filter out.  Then all the dimensions must be verified before sending to Revit.  The accuracy will be questionable since you are working from plots that are shrunk a lot.  When I do it, I attach and scale the pdf and then recreate the truss outline manually.  I do not import pdf vector data.

Architect, Registered NC, VA, SC, & GA.