AutoCAD 2010/2011/2012

Reply
Distinguished Contributor
JIMDONALDSON6595
Posts: 165
Registered: ‎12-07-2010
Message 1 of 9 (596 Views)

PDF and Raster Overlay

596 Views, 8 Replies
03-16-2011 06:59 AM

I'm doing some custom macros and I can't find the command to load and unload PDF's and Raster files.

Anyone know them?

Thanks

 

Jim

*Expert Elite*
rkmcswain
Posts: 3,592
Registered: ‎11-13-2006
Message 2 of 9 (595 Views)

Re: PDF and Raster Overlay

03-16-2011 07:04 AM in reply to: JIMDONALDSON6595

 


JIMDONALDSON6595 wrote:

I'm doing some custom macros and I can't find the command to load and unload PDF's and Raster files.

Anyone know them?

Thanks

 

Jim


 

PDFATTACH

IMAGE

 

See also: AutoCAD Command Reference

Distinguished Contributor
JIMDONALDSON6595
Posts: 165
Registered: ‎12-07-2010
Message 3 of 9 (556 Views)

Re: PDF and Raster Overlay

03-16-2011 11:15 AM in reply to: rkmcswain

Thanks, but not what I'm looking for. For a macro to work I need the keyboard commands. Waiting for a dialog box is a waste of time I'm trying to avoid.

 

Jim

*Expert Elite*
rkmcswain
Posts: 3,592
Registered: ‎11-13-2006
Message 4 of 9 (554 Views)

Re: PDF and Raster Overlay

03-16-2011 11:21 AM in reply to: JIMDONALDSON6595

 


JIMDONALDSON6595 wrote:

Thanks, but not what I'm looking for. For a macro to work I need the keyboard commands. Waiting for a dialog box is a waste of time I'm trying to avoid.

 

Jim


 

Prefix the command name with a hyphen to bypass the dialog.

If you call the command using autolisp, the hyphen is not always required.

 

This information is also found in the AutoCAD documentation referenced above. Did you happen to look up the IMAGE and PDFATTACH command? Also see details here

Distinguished Contributor
JIMDONALDSON6595
Posts: 165
Registered: ‎12-07-2010
Message 5 of 9 (540 Views)

Re: PDF and Raster Overlay

03-16-2011 02:09 PM in reply to: rkmcswain

R K

Thanks for the reply. Yes I looked up the commands on the command list. And Yes I knew about the - prefix for bybassing dialog boxes. Unforetunetly neither of those suggestions helped. App[earently you can unload a PDF or Raster file from the dialog box by right clicking on the appropriate file name. But I cannot find and specific AutoCAD command to to it from the command line.

 

I have found a sorta solution (is there any other kind in AutoCAD lately).

 

If I use the PDF / Image adjust command. I can change the contrast to view or not view the appropriate file.

 

Jim

*Expert Elite*
rkmcswain
Posts: 3,592
Registered: ‎11-13-2006
Message 6 of 9 (538 Views)

Re: PDF and Raster Overlay

03-16-2011 02:21 PM in reply to: JIMDONALDSON6595

 


JIMDONALDSON6595 wrote:

R K

Thanks for the reply. Yes I looked up the commands on the command list. And Yes I knew about the - prefix for bybassing dialog boxes. Unforetunetly neither of those suggestions helped. App[earently you can unload a PDF or Raster file from the dialog box by right clicking on the appropriate file name. But I cannot find and specific AutoCAD command to to it from the command line.


 

You may be correct regarding no ability to detach a PDF from the command line.

Regarding your last two sentences , you mention "raster" again, so I'll mention that you can certainly detach an image from the command line (-Image command)

Distinguished Contributor
JIMDONALDSON6595
Posts: 165
Registered: ‎12-07-2010
Message 7 of 9 (503 Views)

Re: PDF and Raster Overlay

03-17-2011 05:40 AM in reply to: JIMDONALDSON6595

I'm not looking to detach the files, but to unload them. We get a lot of PDF or Raster files that we overlay on to a dwg, then trace over the parts we need to CAD. Depending on the quality of the attached file, it is necessary to be able to see the dwg without the overlay. A quick unload/load would be ideal, but apparently not in AutoCAD. As I mentioned the adjust and contrast settings will work fine.

 

Jim

*Expert Elite*
rkmcswain
Posts: 3,592
Registered: ‎11-13-2006
Message 8 of 9 (501 Views)

Re: PDF and Raster Overlay

03-17-2011 05:45 AM in reply to: JIMDONALDSON6595

 


JIMDONALDSON6595 wrote:

I'm not looking to detach the files, but to unload them.


Ok, you can still unload raster images using -Image.

 

*Expert Elite*
rkmcswain
Posts: 3,592
Registered: ‎11-13-2006
Message 9 of 9 (496 Views)

Re: PDF and Raster Overlay

03-17-2011 05:58 AM in reply to: JIMDONALDSON6595

 


JIMDONALDSON6595 wrote:

I'm not looking to detach the files, but to unload them. We get a lot of PDF or Raster files that we overlay on to a dwg, then trace over the parts we need to CAD. Depending on the quality of the attached file, it is necessary to be able to see the dwg without the overlay. A quick unload/load would be ideal, but apparently not in AutoCAD. As I mentioned the adjust and contrast settings will work fine.

 

Jim


 

Here is a quick "Hide/Show" for PDFs

 

 

;;; =================================
(defun foo ( x / ent obj)
  (setq ent (car (entsel)))
  (setq obj (vlax-ename->vla-object ent))  
  (vlax-put-property obj "UnderlayVisibility" x)
)
;;; Use like this
;;; (foo 0) to hide
;;; (foo 1) to show
;;; =================================

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!