CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
New CADforum look launched.
Over 1.090.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new Engineering calculator. New AutoCAD 2026 commands and variables.
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to deal with filepath to use pdfimport in LISP

 Post Reply Post Reply
Author
cillin View Drop Down
Newbie
Newbie


Joined: 22.Jan.2024
Location: Saudi Arabia
Using: AutoCAD2023
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote cillin Quote  Post ReplyReply Direct Link To This Post Topic: How to deal with filepath to use pdfimport in LISP
    Posted: 22.Jan.2024 at 14:24
Hello CAD users.

I am quite new to AutoLISP. My question here could be silly but please help me out.

The LISP I want to make is a command that imports multiple pdf files.

First, I found this in the forum.
But this is using "pdfattach" command. As I need to modify specific contents in AutoCAD after importing pdf files, I have to use "pdfimport" command, not "pdfattached" command. (pdfattached command doesn't allow me to modify specific text or line after importing pdf file.)

Before coming to a question of how to deal with multiple pdf files in LISP, the first simple thing I just wanted to do is 'running pdfimport command using lisp'.

However, the problem I encountered is that I cannot give the pdf file path by using 'getfiled' function in LISP!!!
I tried to use 'getfiled' to get the pdf file path and used that with the 'pdfimport' but it keeps asking me for the file path by the file selecting dialog window.

Can anyone tell me how I can use getfiled and pdfimport together?

Thanks



Edited by cillin - 22.Jan.2024 at 14:27
Back to Top
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2098
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vladimir Michl Quote  Post ReplyReply Direct Link To This Post Posted: 22.Jan.2024 at 14:40
You are right, the old version used PDFATTACH by mistake - it has been fixed now.
Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner
Back to Top
cillin View Drop Down
Newbie
Newbie


Joined: 22.Jan.2024
Location: Saudi Arabia
Using: AutoCAD2023
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote cillin Quote  Post ReplyReply Direct Link To This Post Posted: 22.Jan.2024 at 15:58
Thanks for such a quick response.

I found that the mpdfimport LISP is updated, but I cannot figure out how I can use the pdfimport function in it.

It asks keyword of either 'Attach' or 'Import'.
And when I enter 'Import', it askes for pdf file path again for every loops in while statement.

Would you please have a look into the script again?

Thank you very much.
Back to Top
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2098
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vladimir Michl Quote  Post ReplyReply Direct Link To This Post Posted: 23.Jan.2024 at 09:03
It works fine here. Are there any error messages in the command line? This is mine:

Command: (LOAD "K:/mpdfimport.lsp") C:MPDFIMPORT
Command: MPDFIMPORT
Initial insertion point:
Page cell width <A4/Letter>:
Start page <1>: 2
End page <999>: 4
Import or attach [Import/Attach] <Import>: I
Import stránky 2 ze souboru PDF: Transformace v MAP.pdf...
Import stránky 3 ze souboru PDF: Transformace v MAP.pdf...
Import stránky 4 ze souboru PDF: Transformace v MAP.pdf...

Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner
Back to Top
yaya69 View Drop Down
Newbie
Newbie


Joined: 24.Jul.2018
Location: France
Using: autocad&spaceclaim
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote yaya69 Quote  Post ReplyReply Direct Link To This Post Posted: 07.Apr.2025 at 16:52

Hi,
I discover your lips , thanks for sharring Smile 

Can I ask you, if it's possible to add one more function in order to replace page on pdf and kep scale, position X,Y, just change page number. I import a plan that each page change weekly (same allignement, same point import).

Currently my workflows is :
-attachPDF page 1,
 -aligned
-and when I want to use other page U need to stard at begin, not very efficient...

Thanks in advance
Yann
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,169 seconds.