Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/04/2021 in all areas

  1. @prodromosm Show Steven P some love for tracking down the problem by hitting a few bottom right of his posts. How about I replace all of PDFPageCount function with 3 lines of code? This will loop with the while command until LastEntity ThisEntity are equal. aka the pdfattach command didn't attach anything last loop. (defun c:atall (/ *error* fn n pt LL UR objwid LastEntity ThisEntity) (setq fn (getfiled "Select PDF File" "" "pdf" 8) n 1 pt (getpoint "Insertion Point") LastEntity T ) (setvar 'cmdecho 0) (while (not (equal LastEntity ThisEntity)) (setq LastEntity (entlast)) (command "-pdfattach" fn n "_non" pt 1 0) (setq ThisEntity (entlast)) (vla-getboundingbox (vlax-ename->vla-object ThisEntity) 'minpt 'maxpt) (setq LL (vlax-safearray->list minpt) UR (vlax-safearray->list maxpt) objwid (- (car UR) (car LL)) pt (polar LL 0 (+ objwid 1)) n (1+ n) ) ) (setvar 'cmdecho 1) (princ) ) --Edit-- Cut down the spam with cmdecho. Cant seem to suppress the error msg. When its trying to insert a page that isn't there.
    2 points
  2. I am not an expert in the below, just having a random guess..... Something I just read that might be something, might not be. The pagecount LISP and another I just looked at are looking in the PDF for a text pattern 'pages' ? I think So if the OPs PDF doesn't have 'page'' it can't find it in the PDF when it searches - and the result is 'nil' (see above for what the LISPS were telling us). Just a guess though I have been looking and can't find a PDF without page numbering.. however this is assuming English language 'page' what would be the case if we used another language for the PDF? Personal question time Prodromosm - is English your first language or is your PDF created in another language? and what is the word for 'page' Just a guess......
    1 point
  3. Tried just that line that in AutoCAD, it accepts the path to PDF OK, and then it gets upset at # (being larger than the number of pages) "There is no # in PDF Enter page number or [?]" so it moves on and selects the point "There is no 0,0 in PDF Enter page number or [?]" Now it selects page 1 (which is the 1 from scale, it will insert page 2 if you change 'scale' to 2) Now it selects 0 as insertion point (the last point you used?) Then it pauses asking for scale factor Then it pauses asking for rotation Then it inserts the sheet So the "default back to page 1" is actually it picking up the scale.
    1 point
  4. Using Autocad 2014. I input the following: (command "-pdfattach" "C:/users/Steve/Desktop/MIXED.PDF" 42 '(0 0 0) 1 0) This is a 15-page PDF. The result was an empty rectangle and a prompt to specify scale factor, then rotation, then it pastes sheet 1 and exits. Same results regardless of page number specified, so long as specified page is greater than the PDF contains. Tested again with Autocad 2020. Same results. Steve
    1 point
  5. That works perfectly in Autocad 2014. Thanks to you and Steven P for your efforts. Cheers and beers all around. Steve
    1 point
  6. This forum is based on English so please use google translate. I have a Lisp routine that I need to convert the color rescued from the code 420 that returns it to me decimally to a true color nu rgb. Colour Conversion Functions | Lee Mac Programming (lee-mac.com) (420 . 4569739) (LM:True->RGB 4569739) (69 186 139)
    1 point
  7. Simple fix, count your -> and <- must match.
    1 point
  8. He says he tried it without that, about 8 posts up,
    1 point
×
×
  • Create New...