Site Navigation
WHIP! / Using WHIP! / Generating DWFs < You Are Here

Generating DWFs


WHIP!
Readme
| Installing
WHIP!
| Viewing
DWFs
| Generating
DWFs
| Publishing
DWFs
| Maintaining
WHIP! Locally

You can use AutoCAD 2000 or AutoCAD Release 14 to generate DWF (Drawing Web Format) files. For information on using AutoCAD 2000 to generate DWF files, refer to your AutoCAD 2000 documentation. This section describes how to generate DWF files using AutoCAD Release 14.

To generate a DWF file using AutoCAD Release 14, you first need to obtain the AutoCAD Internet Utilities. To use the AutoCAD Internet Utilities, you must have installed the following:

  • AutoCAD Release 14
  • Windows NT 3.51 Service Pack 4, Windows NT 4.0, or Windows 95
This section includes the following topics:

Installing the AutoCAD Internet Utilities

The AutoCAD Internet Utilities are composed of three ObjectARX applications: DWFOut.ARX, DWFIU.ARX, and Internet.ARX. Because DWF is one of the available output types on the AutoCAD R14 File Export menu, the DWFOut.ARX application gets installed on your system as part of a Typical AutoCAD Release 14 installation; however, since all AutoCAD users do not have internet access, the other two applications are NOT part of a Typical Install. To use the URL related commands or perform drag and drop, you must have performed a Custom installation.

To output DWF files from paper space, to generate ASCII DWF files, and to use international text, you must obtain Autodesk's newer DWFOut.ARX application. To attach and detach URLs in paper space, you must obtain Autodesk's newer DWFIU.ARX application. You can get both of these by downloading one self-extracting executable: aiu31.exe. This executable replaces the original applications with the newer ones.

On a system where you have already performed a Custom install of AutoCAD Release 14:

  1. Download aiu31.exe from the Autodesk web site.
  2. Make sure AutoCAD is not running.
  3. Run aiu31.exe by double-clicking it, then follow the on-screen instructions.

Return to Top


Using the ObjectARX Applications to Generate a DWF File

Once you have installed the AutoCAD Internet Utilities, you can begin using the AIU features.

There are five commands available with AutoCAD Internet Utilities:

  • DWFOut
    Saves the open DWG file as a DWF file.
  • AttachURL
    Enables you select one or more objects or a region in a drawing file and associate these objects or regions with an URL. When a user views the DWF file across the web and selects the URL, their browser will navigate to that web site.
  • DetachURL
    Enables you select one or more objects in a drawing file and remove the URL or URLs associated with them.
  • ListURL
    Enables you to select one or more objects in a drawing file and list the URLs that are associated with them.
  • SelectURL
    Enables you to select all of the objects in a drawing file that have URLs that associated with them.

Return to Top


Saving DWG Files in DWF Format

To Save DWG Files in DWF Format:

  1. Start AutoCAD and open a drawing file.
  2. On the command line, enter DWFOut.
    The Create DWF File dialog opens.
  3. Enter the name you want for the DWF file.
    The DWG file name is used as a default with a .dwf extension.
  4. Click Options to open the DWF Export Options dialog from which you can change the following settings:
    • Format
      Select Compressed Binary for a compressed binary DWF file. You can select uncompressed Binary, if you do not want compression (this is unlikely).
      If you need to modify a DWF file through an external process such as perl, you may find it easier to work with an ASCII DWF file.
    • Precision
      Select the precision (low, medium, or high) you want. The higher the precision, the more detail you can retain in the file; however, with more detail, the file size increases. For complex files you may want to experiment with increasing file size by increasing precision. The default is to use medium (20-bit) precision which is usually sufficient for most files.
    • Include Layer Information
      Include layer information is selected by default. If you want to generate a DWF file without layer information, for example so that browser users cannot turn layers off, you can clear this check box by selecting it.
  5. Choose OK.
The file is saved in DWF format. You can now place a reference to the DWF file in any HTML file and view it with WHIP!.

If you want to save a DWF file and generate an HTML file each time you save the DWG, you can download a lisp routine from ftp://ftp.autodesk.com/pub/whip/readme/saveall3.lsp.

After loading saveall3.lsp through the AutoCAD Tools menu Load Application command, you can issue a saveall3 command and the lisp script will run. The saveall3 lisp code assumes that the DWG and DWF files already exist, so it issues a "y" (yes) to allow them to be overwritten.

Turning Off File Dialogs

The DWFOut command opens a dialog that enables you to supply a file name for the DWF file, to optionally turn off compression, or to adjust the precision. To facilitate DWF file generation in batch mode, the AutoCAD FILEDIA (FILE DIAlog) variable can be set to 0. When set to 0, prompting for the DWF file name, compression, and precision is done in the command window instead of through a file dialog box. From the command line, you can issue a command of the form:

DWFOut <filename> {a | b} {l | m | h} {y | n} {y | n}
where:
  • <filename> is the name of the DWF file, for example myfile.dwf
  • l or m or h indicates the type of precision
    (l = low = 16-bit, m = medium = 20-bit, h = high = 32-bit)
  • y or n indicates whether compression is enabled
    (y = yes, n = no)
  • y or n indicates whether layer information is included
    (y = yes, n = no)
To restore the file dialog box operation, use setvar FILEDIA to 1.

Geometry in a DWF

Under normal circumstances, all of the geometry contained in a DWG gets written to the DWF file. This is by design. The rationale behind this design is that this allows users the freedom to pan a DWF to see other parts of a drawing. Hence, the DWFOut command does not provide a means to crop a DWG to a particular subset. Using the word "all" is an oversimplification. Actually, the geometry that is written to the DWF file is all the geometry that AutoCAD has in its display list. In cases where the current view depicts a very large drawing that is tightly zoomed in, any geometry that falls outside of the AutoCAD display list will not be contained in the DWF file. Furthermore, commands such as VIEWRES, FACETRES, DISPSILH and HIDE that affect the visibility of geometry on the display screen also affect the contents of the DWF file.

Images in a DWF

One of the advantages of the DWF format is that it is vector-based. DWF files are stored using high-level primitives such as polyline, polygon, polytriangle, marker, circle, ellipse, arc, and text. A vector-based format allows for speedier pans and zooms over other formats such as bitmaps.

In contrast, AutoCAD Release 14 allows the insertion of images into DWG files. When a DWFOut command is issued for a DWG file with an image, the image data is compressed and saved into the DWF file in one of the following formats:

  • indexed
  • mapped (with transparency)
  • JPEG
  • RGBA
  • Group3 FAX
  • gray scale

Since the DWFOut ObjectARX application determines the best format to use to save the image data, there is nothing that you need to do. To preserve the speediness of pans and zooms for a DWF file with an image, during a pan or zoom, the image is replaced with a purple bounding rectangle to represent the image.

Raster images in DWG files are a challenge when generating the corresponding DWF. There are two problems:

  • Image data can be huge (satellite photos can be Gigabytes in size) and DWF files are supposed to be small.
  • There are many different formats that raster data can come from. WHIP! cannot deal with every possible format since it is a small program designed for easy download.
For these two reasons, the DWFOut ObjectARX application does some some manipulation and processing on images it finds in the DWG. This processing may lead to image degradation when viewed with WHIP!. The amount of degradation is controlled by the Precision DWFOut option and the size of images being stored.

This is how DWFOut works:

  1. The image found in the DWG is converted into a format that WHIP! supports: JPEG, CCITT Group 3, RGBA, Indexed 8, or Mapped 8.

    Although there are many image formats (like GIF, JPEG, PNG, etc.), they are all uncompressed internally by AutoCAD into only a few pixel formats. DWFOut is not concerned with the original file format, but instead considers the source pixel format.

    Original DWG Image Pixel TypeConverted To DWF Format
    RGBJPEG
    RGBA (low/medium precision)Mapped 8 with LZ77 post process
    RGBA (high precision)RGBA with LZ77 post process
    Mapped 8 colorIndexed 8 with LZ77 post process
    Mapped 8 color w/transparencyMapped 8 with LZ77 post process
    Mapped 8 greyscaleJPEG
    Mapped 8 gray w/transparencyMapped 8 with LZ77 post process
    BitonalCCITT Group 3

    This conversion is the source of some image quality degradation. Formats like JPEG are lossy formats, and thus some quality is lost. When mapping an RGBA image to a "Mapped 8", some color quality is lost, but you have the benefit of a file that is 1/4 the size. Generally RGBA images are just too large to be interesting for a DWF file, since a 1000 x 1000 pixel RGBA image would take 4 megabytes. Using LZ77 data compression, the 4 megabytes could be reduced, but would still be very big. Only in high precision mode do we support RGBA in DWF.

  2. The next step is an image resize operation. If Low Precision has been selected, then DWFOut automatically resizes the image to be 1/2 the size horizontally and 1/2 the size vertically (so the resultant image has 1/4 the pixels compared to the source image stored in the DWG). This further degrades image quality, but produces a much smaller file. When Low Precision is selected, it is usually because the user wants a small file and is not be concerned with image quality. In Medium or High Precision modes, this kind of forced image reduction is not performed.
  3. Next the image may be reduced further in size. DWFOut has a threshold image size (based on precision level) that it maintains. Any image larger than the threshold has its resolution reduced. The threshold value is compared to what the size of the image is *predicted* to be if it were to be compressed at its current size.

    FormatPredicted Size of Image After Compression
    CCITT Group 3width * height * 1/8 * AVERAGE_GROUP3_FACTOR
    Indexed 8width * height * AVERAGE_LZ77_FACTOR
    Mapped 8width * height * AVERAGE_LZ77_FACTOR
    JPEGwidth * height * 3 * AVERAGE_JPEG_FACTOR
    RGBAwidth * height * 4 * AVERAGE_LZ77_FACTOR

    ConstantValue
    AVERAGE_GROUP3_FACTOR0.2
    AVERAGE_LZ77_FACTOR0.7 (or 1.0 if data compression isn't selected)
    AVERAGE_JPEG_FACTOR0.15

    PrecisionLevel Threshold
    Low65,536 bytes
    Medium262,144 bytes
    High1,048,576 bytes
    ASCII32,768 bytes

    For example, if you had an RGB image in AutoCAD with a resolution of 2000 by 2000 pixels, and if you were in high precision mode, the JPEG format would be selected and would have a predicted image size of 1,800,000 bytes.

    This exceeds the threshold by a factor of about 72%, so the image would be reduced in size so that there would be 72% fewer pixels. In this example the image would be reduced to a size of 1527 by 1527 pixels before actually compressing and storing the image in the DWF.

    JPEG and Group 3 formats provide much better compression ratios than the other supported formats, and they do so with much better image quality. You can greatly improve the quality of your DWF images by using DWG images in formats that will be converted to JPEG or Group3.

    There are reasons why not all formats are converted to JPEG or Group3. If the source image in the DWG had been stored as 8-bit data (as with GIFs or PNG files) then these images are normally dithered. The JPEG algorithm does a horrible job trying to compress dithered data. Also, if you have rotated an image in the DWG or used a clipping polygon to cut holes in a DWG image, then the output image will have some transparent pixels. Unfortunately JPEG doesn't support transparency, so DWFOut is forced to select an alternate format (which may degrade image quality due to resolution reduction).

Background Color & File Size of DWF

The DWF file is stored with the same background color as you have selected for the main AutoCAD window. The background color information (and other color information) normally adds about 1K of storage to a DWF file. Whenever a black or white background is used, this color data is reduced to only 3 bytes, which may be of interest when dealing with extremely small DWF files (less than 5K or so). As a result, using a black (or white) background with 16-bit precision can be a powerful combination to reduce file size.

Precision & File Size of DWF

WHIP! and DWF allow binary DWF files to be between 16 and 32 bits of precision. The AutoCAD Internet Utilities ObjectARX application features a variable precision selector that allows you to select the desired precision.

For common drawings of CAD parts and basic AEC drawings, using 16-bit precision gives you 40% smaller DWF files! Before, with 32-bit DWF you were often getting 5-to-1 compression ratios of DWG-to-DWF. With 16-bit, often you can get as much as 8-to-1. Although they are less accurate, for sample drawings like HVAC.DWG, FILTER.DWG, and so on, there is little visual difference at 16-bit. One can see it, but for the untrained eye, it is hard to tell.

Drawings of more complexity and fine details, like PLAN.DWG, RICHMOND.DWG, or MARINALL.DWG, and so on, would have accuracy problems if done at 16-bit. With the precision selector (low, medium, or high) you can get the level of precision you want. If 16-bit is not precise enough for you, you can use 20-bit precision. Using 20-bit precision ends up being 16 times more precise but only about a 20% larger file than a 16-bit file (and still about 30% smaller than a full 32-bit file).

DWG Named Views in DWF

Any named views that are present in the DWG file (when the DWF file is generated) get recorded in the DWF file. For convenience, if the named view INITIAL is not already specified in the DWG, this named view is automatically placed in the DWF file. The INITIAL view for the DWF matches the view of the DWG when the DWFOut command was issued. Named views of DWF files are available through a right click menu in WHIP!. Named views can also be used in DWF file references in HTML files.

DWG Layers in DWF
  • Visibility
    Any layers that are visible in the DWG file when the DWF file is generated get saved and recorded in the DWF file. In other words, you can't use WHIP! to turn layers on that were off when the DWF file was created.
    Control of layer visibility in DWF files is available through a right click menu in WHIP!. Layer visibility can also be controlled through DWF file references in HTML files.
  • Blocks
    AutoCAD has a very sophisticated process of manipulating blocks and layers. DWF files, which are intended for AutoCAD and nonAutoCAD users alike, have a simpler model. There are no blocks in a DWF file. A DWF file contains geometry, color, layer info, and URLs. Each piece of geometry has one color, one layer, and one (or none) URL. So when a DWF file is generated from a DWG, some layer simplification can potentially occur with respect to blocks.
    In terms of what is in the DWF file, all of the geometry that comprises a block is placed on the layer where the block was inserted. As an example: You create some geometry on layer 0 and then use that geometry to create a block named CHAIR. You then insert the CHAIR block several places on a layer called FURNITURE. When a DWF file is generated, all of the geometry that comprises all of the chairs will be on the FURNITURE layer. WHIP! users can then toggle the FURNITURE layer on and off.
DWG File Name in DWF

When the DWFOut command is issued, the name of the current DWG file is written to the DWF file. This allows the drag and drop capability of WHIP! to grab the original DWG file when the DWF file is dragged and dropped. If a DWFOut command is issued before a drawing is ever saved, the file name Drawing.dwg will be present in the DWF. Furthermore if a DWG file is renamed after DWFOut has been issued, the DWG name inside the DWF file is not updated. Only the name of the DWG file is placed in the DWF file, not the path. This is why DWG files must reside in the same directory as their DWF counterparts for drag and drop to work. On the other hand, this strategy allows DWG/DWF files to be used locally and then moved to internet servers for public access.

DWG file names embedded in a DWF file are case sensitive. This has created confusion for users who generate DWF files on Windows NT and then move those files (both DWG and DWF) to Unix-based servers. Consider the following scenario provided by a user.

    When a DWF file is created in AutoCAD using the 'DWFOut' command, the EXACT filename of the original DWG file is stamped inside it, including the EXACT case. This is so that WHIP! knows what file to look for when someone initiates a 'drag and drop' or a 'save as...'. All of our DWF files were created on an NT machine with capitals for the filename and lowercase for the extension like this:
    AD01850T.dwg or AD01850T.dwf
    This is the name that was stamped inside the DWF file.

    The next thing we did was ftp all of our files up to a Unix box. An extremely common thing to do when you ftp is to convert everything to lowercase. So after we pushed the files to our Unix server, our file name was this:

    ad01850t.dwg or ad01850t.dwf
    This meant that when we initiated a drag and drop on the server, WHIP! looked inside the DWF file, pulled out the original file name of the DWG (AD01850T.dwg), looked in the same directory for it, and couldn't find it because the DWG file name was converted to lowercase (ad01850t.dwg). Simply put, Unix is case sensitive, NT is not.
Thanks to Steve Ludin for pointing this out.

DWG Description in DWF

When you choose the About WHIP!... command from the right click menu in WHIP!, WHIP! displays information about the DWF file. One of the pieces of information is description. Prior to release 3, the description has always defaulted to <none>. The DWFOut.ARX ObjectARX application now uses the contents of the AutoCAD *USERS1 (User String 1) variable as the description. Although this variable is not saved with the drawing, it can be set prior to issuing a DWFOut command so that the desired description will appear in the DWF file:

setvar *USERS1 This is the floor plan of my house.
The *USERS1 variable was selected because it is long enough to contain a meaningful description. Other variables were considered, for example, PROJECTNAME which is saved with the drawing; however, setting these variables to contain the description led to adverse side-effects or the variables' maximum lengths were too short.

The AutoCAD *USERS2 (User String 2) variable can be used to define what one unit in your drawing refers to as in:

setvar *USERS2 feet
You can use *USERS2 to specify feet, miles, centimeters, or whatever units are implicit in your AutoCAD drawing. This information will then be recorded in your DWF file and visible as part of the Location display from the WHIP! right click menu.

DWG Fonts in DWF

When a DWG contains text written using a traditional AutoCAD SHX font, AutoCAD places geometry, for example, lines, in the DWF file to mimic the outlines of the characters represented by the font. As a result, users who use WHIP! to view the resulting DWF file do not need to have SHX fonts on their systems.

When a DWG contains text written using a Windows TrueType font, AutoCAD records the text string and the font (for example, Arial) used in the DWF file. The primary advantage is that the DWF file is smaller. A second advantage is that the text rendering is more pristine since the system is used to draw the characters. The disadvantage is that users who view the DWF file must have the font on their systems. When users do not have the necessary font, jibberish appears which has been described in the newsgroups as "goofy text." Goofy text can also result when a low or medium precision DWF file is created from a paper space layout. For paper space, use high precision.

Paper Space versus Model Space

AutoCAD Release 13 and AutoCAD Release 14 (as shipped) did not output DWF files from paper space. Instead, the DWFOut ObjectARX application for those releases focussed on model space. When a DWFOut command was issued from a model space viewport, the application would dump all of the geometry in the DWG file (even vectors outside of the visible area of the viewport) to the DWF file. Technically what was happening was that all of the geometry contained in the AutoCAD display list was written to the DWF file.

The new DWFOut ObjectARX application (included in aiu31.exe) enables DWF files to be created from paper space viewports. In an attempt to mimic the behavior of generating DWF files from model space, the application writes out the geometry for paper space viewports where those viewports are not currently visible. Although this approach makes the treatment of model space and paper space consistent, the side effect is that the application can appear to modify the DWG but actually does not. In other words, to be able to dump the geometry in viewports that are totally off of the screen, the application moves the current view so that the graphics system thinks that all viewports are visible. As one would expect, it restores the viewport when it is done; however, the changing and restoring of the offscreen viewports toggles the bit that indicates that the DWG has been modified. Thus, if you read in a DWG, view as paper space, and issue a DWFOut command, when you attempt to exit, AutoCAD will ask you if you wish to save your changes. You can chose to save or not save. It does not matter.

A second issue with this strategy is that making the viewports visible requires a REGEN. For very large DWG files, this can be time consuming. If you would like DWFOut.ARX to ignore invisible paper space viewports and simply not write the geometry for those viewports to the DWF file, you can set the AutoCAD variable REGENMODE to 0. By default, REGENMODE is set to 1. You should only set REGENMODE to 0 if the REGEN takes too long.

Converting All DWGs in a Directory to DWF Files

To generate DWF files for all of the DWG files in a directory, you would run a Lisp routine that:

  • Shells out
  • Does a "dir *.dwg /b > filename.txt" (in DOS)
  • Exits the shell
  • Writes a new (AutoCAD script) file which does a DWFOut for each DWG in filename.txt
  • Finishes writing the script
  • Calls the script
Sample lisp code, mapdir.lsp, is provided at ftp://ftp.autodesk.com/pub/whip/readme/mapdir.lsp.

To use mapdir.lsp, AutoCAD must have a working directory that contains DWG files. The easiest way to accomplish this is to modify the "Start In" property of the icon that launches AutoCAD to point to the directory where the DWG files are located, for example c:\Program Files\AutoCAD R14\Sample.

Return to Top


Embedding an URL in a Drawing

There are two basic ways to embed URLs in drawings. URLs can be attached to specified objects (that is, geometry) or attached to a specified area of a drawing. Regardless of whether URLs are attached by objects or by area, you can select geometry first and then attach the URL or issue the AttachURL command and then select the geometry. So there are four possible combinations. All four combinations are described later in this section.

  • When a URL is attached to geometry using "by objects", a rectangular URL region is placed around each piece of geometry that has been selected. The URL is saved in the DWG file as "x-data" for each piece of geometry selected. So there are many "little URL regions" when the "by objects" means is used.
  • When a URL is attached to an area, the ObjectARX application creates a new AutoCAD rectangle to match the specified area and places the newly created rectangle on a layer called URLLAYER. The URL is saved in the DWG file as "x-data" for the newly created rectangle. So there is one "big URL region" when the "by area" means is used.
The determination as to when to attach URLs by objects or by area depends on the situation. For contiguous geometry, an area is most effective. In cases where geometry is distributed throughout the DWG, using objects is more effective.

The area mechanism is very effective for providing URLs in spots of a drawing where no geometry is present. AutoCAD Release 14 stores embedded URLs in the DWG file. Each time you save a DWF file, AutoCAD Release 14 copies the URLs from your DWG to the DWF file. Keeping the URLs in the DWG allows you to update your drawings without losing your links.

Attaching a URL by objects with No Geometry Selected

To attatch a URL with no geometry selected:

  1. Start AutoCAD and open a drawing file.
  2. On the command line, enter AttachURL.
  3. On the command line, enter O for Objects.
  4. Select the geometry that you want to associate with the URL.
  5. Enter the full name of the URL, such as http://www.autodesk.com.
    Whatever you type gets passed from WHIP! to the browser. If your browser requires the http:// part, include it. You can type in fully qualified URL names, for example, http://www.acme.com/widget.htm, or relative URL names, for example, widget.htm. There is nothing about passing the information from the DWF file to the browser that is dictated by WHIP!. WHIP! just takes the string "as is" and passes it to the browser; however, please note that entering an URL of www.autodesk.com for a browser that does not require the http:// part will be interpreted as a relative URL. So unless you have a file on your local system called www.autodesk.com, you will want to use URLs such as http://www.autodesk.com.
  6. Save the DWG file.
  7. Save the DWG file as a DWF file using the DWFOut command as described above.

When users view the file across the web and select the URL, they will be linked to the associated web site.

Attaching a URL by objects with Geometry Already Selected

To attach a URL by objects with geometry already selected:

  1. Start AutoCAD and open a drawing file.
  2. Select the geometry that you want to associate with the URL.
  3. On the command line, enter AttachURL.
  4. On the command line, enter O for Objects.
  5. Enter the full name of the URL, such as http://www.autodesk.com.
  6. Save the DWG file.
  7. Save the DWG file as a DWF file using the DWFOut command as described above.

Attaching URLs by objects works equivalently whether geometry is selected before or after the AttachURL command is issued.

Attaching a URL by area with No Geometry Selected

To attach a URL by area with no geometry selected:

  1. Start AutoCAD and open a drawing file.
  2. On the command line, enter AttachURL.
  3. On the command line, enter A for Area.
  4. Use the mouse to select the rectangular region to associate with the URL.
  5. Enter the full name of the URL, such as http://www.autodesk.com.
  6. Save the DWG file.
  7. Save the DWG file as a DWF file using the DWFOut command as described above.

Attaching a URL by area with no geometry previously selected provides you with an opportunity to select the area using the mouse. A rectangle is created to match the area you selected with the mouse. The rectangle is placed on the URLLAYER layer. The URL is associated with the new rectangle.

Attaching a URL by area with Geometry Already Selected

To attach a URL by area with geometry already selected:

  1. Start AutoCAD and open a drawing file.
  2. Select the geometry that you want to associate with the URL.
  3. On the command line, enter AttachURL.
  4. On the command line, enter A for Area.
  5. Enter the full name of the URL, such as http://www.autodesk.com.
  6. Save the DWG file.
  7. Save the DWG file as a DWF file using the DWFOut command as described in the previous procedure.

Attaching a URL by area with geometry already selected instructs the ObjectARX application to generate the area for you by computing the bounding box of the selected geometry. So unlike the previous case where no geometry had been selected and you circumscribed the area using the mouse, the ObjectARX application can determine the area based on the selected geometry. The ObjectARX application then creates a rectangle to match the computed area, places the rectangle on the URLLAYER layer, and associates the URL with the rectangle.

Creating DWF Files with URLs Using Lisp

The internet lisp functions require that the DWFOut.ARX application is loaded to operate. In lisp, to check if the DWFOut.ARX application is loaded, use the following code:

(if (/= (type geturl) 'EXRXSUBR)
(arxload "dwfout")
)

SETURL

Two handy functions when working with URLs and lisp are seturl and geturl.

(SETURL ename "URL string")
The SETURL function expects two variables: the entity name and the URL string.

Example:

(seturl (car (entsel)) "http:/www.autodesk.com")
This example prompts the user to select an object. Once the object is selected, the URL string is attached to that object.

GETURL

The counterpart to seturl is geturl.

(GETURL ename)
The GETURL function expects one variable -- the entity name. GETURL returns the URL string from an entity. If no URL string is found, it returns nil.

Example:

(geturl (car (entsel)))
This example prompts the user to select an object. Once the object is selected, the URL string is displayed back to the user. If there is no URL string associated with the selected object, nothing happens.

Example: Creating DWF Files Using Lisp

Creating DWF files using Lisp is best illustrated by an example our QA legion uses to test WHIP! and DWF. The file cdwf.lsp is provided as a sample available at:
ftp://ftp.autodesk.com/pub/whip/readme/cdwf.lsp.

Return to Top


Removing URLs in a Drawing

URLs are detached using the DetachURL command. You can select geometry and then issue the DetachURL command, or issue the command and then select the geometry. There are two types of URL removal that are automatically handled by the ObjectARX application:

  • If a URL is detached from geometry, it is simply removed.
  • If a URL is detached from a rectangle that was created by the ObjectARX application for the sole purpose of attaching a URL, that is, the rectangle is on the URLLAYER layer, the rectangle is deleted.
Attempts to select geometry items without URLs and use DetachURL results in the standard ObjectARX message: N items filtered out.

Return to Top


Viewing URLs in a Drawing

To view URLs in a drawing:

  1. Start AutoCAD and open a drawing file.
  2. On the command line, enter ListURL.
  3. Select the objects for which you want to see the associated URLs.
  4. The associated URLs for those objects are listed in the Text window.

An alternative method is to issue the SelectURL command to select all of the objects that have URLs associated with them, and then issue the ListURL command. Attempts to select geometry items without URLs and use ListURL results in the standard ObjectARX message: N items filtered out.

Return to Top


Selecting Objects and Areas with URLs Attached

You can select all objects and areas that have URLs attached. AutoCAD puts all objects and areas that have URLs attached into the current selection set so you can edit them.

To select objects and areas with URLs attached:

  1. Start AutoCAD and open a drawing containing objects with URLs attached.
  2. From the Internet Utilities toolbar or Internet menu, choose Select URLs, or enter selecturl at the Command prompt.
    AutoCAD selects all objects that have URLs attached.

Return to Top


Using Lisp to Access URL Information

Accessing URL information in a DWG using Lisp is best illustrated by two lisp functions:

  • ALLURLS
    Scrolls a list of all URLs found in an entire DWG to the command line. Duplicates are not removed.
  • PICKURL
    Scrolls a list of all URLs found in a selected set of entities (user prompted to select). Again, duplicates are not removed.
A sample, allurls.lsp, is available at:
ftp://ftp.autodesk.com/pub/whip/readme/allurls.lsp.

Return to Top


Uninstalling the AutoCAD Internet Utilities

The installer for the AutoCAD Internet Utilities does not feature an uninstaller. The installer does not write any entries to the registry. If for some reason you are having problems with the AutoCAD Internet Utilities, you can easily revert back to the as-shipped Release 14 functionality. To do so, simply replace the following files with the originals from the Release 14 CD:
dwf3.hdi
dwffont3.hdi
dwfiu.arx
dwfout.arx
whiptk.dll

These files are all located in the directory where AutoCAD is installed.

Return to Top


Download WHIP! | Product Overview | What's New | Using WHIP! | Developer Zone | Redistributing WHIP! | WHIP! Gallery

Home | Products | Tech Assist | Autodesk | Prof Net | Search | Sitemap | Purchase

© Copyright 1999 Autodesk, Inc. All rights reserved.
Reproduction or copying of images is prohibited.
Autodesk Privacy Policy

Contact Autodesk