Jump to content

Recommended Posts

Posted

Hi All,

 

Every single time i import a pdf i need to set a scale of 2539.9965. This just seems to be the magic scale number which results in the pdf measuring correctly.

The way i normally do it is drag the pdf into autocad, specify page number (usually try to have single sheet pdf so can just press enter for page 1), pick location, enter 2539.9965 for scale, and then enter 0 for rotation.

What i'd like to be able to do is drag pdf into autocad, choose location and thats it. Everything else is repetitive. Thought maybe i could use command line (-pdfattach) but that doesn't seem to let you drag/drop pdf into autocad, it asks for filepath to pdf location which would take too long to enter every time

Any ideas would be muchly appreciated!

Posted (edited)

Are these pdf in the same folder as the drawing? if so this is quick and dirty.

 

;;----------------------------------------------------------------------------;;
;; INSERT PDF FROM DRAWING LOCATION
(defun C:foo (/ fp)
  (if (setq fp (getfiled "Select PDF" (getvar 'dwgprefix) "pdf" 0))
    (vl-cmdf "-pdfattach" fp "" pause "2539.9965" "0")
  )
  (princ)
)

 

If they are in a different location.

 

;;----------------------------------------------------------------------------;;
;; Insert PDF FROM LOCATION
(defun C:foo (/ path fp)
  (setq path "C:\\Folder\\Location")                   ;Change to your location
  (if (setq fp (getfiled "Select PDF" path "pdf" 0))
    (vl-cmdf "-pdfattach" fp "" pause "2539.9965" "0")
  )
  (princ)
)

 

 

 

Edited by mhupp
Posted

I am only guessing here but.....2539.9965 is pretty close to inch to mm conversion at 1:100 isn't it?

Posted

Even more of a guess - I wonder why the magic number of 2540.0000000 doesn't work!

Posted
7 hours ago, mhupp said:

Are these pdf in the same folder as the drawing? if so this is quick and dirty.

 

 

If they are in a different location.

 

 

ahhh thats awesome! pdf won't always be in same location. quick and dirty is all i need. thankyou!!

 

4 hours ago, Steven P said:

I am only guessing here but.....2539.9965 is pretty close to inch to mm conversion at 1:100 isn't it?

 

indeed it is

 

2 hours ago, eldon said:

Even more of a guess - I wonder why the magic number of 2540.0000000 doesn't work!

 

2540 does work.. i think 2539.9965 was possibly to suit a specific clients drawings which may have been slightly off..

 

either way i've never been able to work out why it even needs to import with this imperial reference when every other setting is using metric? i've always thought i should be able to import these 1:100 drawings with scale of 1 or 100 something like that. gave up a while ago trying to work it out. am i missing something?

Posted

I think the next question will be - how to insert many pages of one pdf file.
Therefore, in advance the answer is - AutoImportCAD

Posted (edited)

The scale factor thing is probably to do with pixels is it left or right, the original pdf can made at various DPI, Dots per inch, the more maybe closer to 2540 but size uses like x squared for every size increase Kb becomes Mb in file size. The pdf will have vectors but decimal places creep in.

 

Playing with Tiffs A1 size made from title block then printed again at A1 the size was 801 the new plot 801.5 It really did not matter, the true measurements were on the plot.

 

Chuck in a plot pdf fit and see what you get.

Edited by BIGAL
Posted
14 hours ago, maratovich said:

I think the next question will be - how to insert many pages of one pdf file.
Therefore, in advance the answer is - AutoImportCAD

 

not sure if that would have been the next question but i'm always keen to check out new things like this so thanks for the link!

 

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