CADvisory Online

 

The Oldest and Most Dangerous AutoCAD User Group
http://www.VAUS.bc.ca

February 2000

Bill Fane

Here are a couple of quick Lisp routines that originated from requests from CADalyst readers.

DIM-SUM.lsp

No, this is not a Chinese lunch. Someone wanted to be able to select a series of dimensions from a drawing and read their sum total. The normal DISTANCE command would not work because the distances were a mix, and may include horizontal, vertical, and aligned ones. Note the bit of a programming trick in here. Normally, Lisp cannot access the value of dimension text directly from the object because AutoCAD does not store it. Instead, it calculates it "on the fly" based on the dimension definition points. The trick here is to explode the dimension which turns it into lines, arrowheads, and text. I extract the text value then UNDO to reassemble the dimension.

(princ "\nDIM-SUM dimension summer copyright by Bill Fane 1999")

;; 01 November 1999.
;; All rights reserved.  May not be sold for cash or traded for anything
;;  of value except for ski passes to Whistler.
;; No warranty expressed or implied.  Make a backup copy of your drawing first.

;; Runs automatically when loaded.
;; Command is DIM-SUM to collect the sum total of a series of selected dimension 
;; text items.
;; NOTE that it adds zero if the dimension text does not start with a number.  
;; This includes
;;   diameter and radii preceeeded by the diameter symbol or R, reference dimensions 
;; surrounded by parentheses, or any dimension text preceeded by a user-added text note.
;; It loops as long as the user picks a point with mouse; it ends and displays the 
;; total when they
;;  hit <enter>.


(defun c:DIM-SUM
( / ;; declare all variables as local:
DT ;; dimension running total
DL ;; last dimension value selected
SS ;; selection set
CE ;; holds "command echo" variable
PT ;; point picked by user
ED ;; entity data
TE ;; text entity
)
(setq ;; initialize variables
DT 0.0
DL 0.0
SS nil
CE (getvar "cmdecho")
)
(setvar "cmdecho" 0)

;; loop as long as they pick a point.  If they hit <enter>, drop through to the end.

(while (setq PT (getpoint "\nSelect dimension text: "))
;; if they picked a point, did they select anything?
(if PT
(setq SS (ssget PT))
)
(if (not SS)
(alert "Nothing selected!")
;; if they picked something, was it a dimension?
(progn
(setq ED (entget (ssname SS 0)))
(if (/= (cdr (assoc 0 ED)) "DIMENSION")
(progn
(alert "Selected item is not dimension text!")
)
;; if they picked a dimension, convert it to decimals & explode it
(progn
(command "dimoverride" "dimunit" "2" "" PT "")
(command "explode" PT)
;; did they pick the dimension by selecting its text?
(setq
TE (entget
(ssname
(ssget PT)
0
)
)
)
(if (/= (cdr (assoc 0 TE)) "MTEXT")
;; if not picked by text, back up
(progn
(command "u" "u")
(alert "Selected item is not dimension text!")
)
;; explode the dimension Mtext to get regular text from it
(progn
(command "explode" PT)
(setq ED (entget (entlast)))
;; undo thrice to unexplode the text and dimension
(command "u" "u" "u")
;;  extract the dimension text, convert to number,
;; and add to total
(setq DL
(atof
(cdr
(assoc 1 ED)
)
)
DT (+ DT DL)
)
)
)
)
)
)
)
;; display current value and running sub-total
(princ "\nCurrent:  ")(princ DL)(princ "  Sub-total ")(princ DT)
;; end of main "did they pick a point" loop
)
;; when they hit <enter> instead of picking a point then finish things off.
(setvar "cmdecho" CE)
;; Display total in an alert box.  You can add Text command etc to add "value" to drawing.
;; Grand total is held in variable DT as real (floating point) number.
(alert (strcat "Selected dimensions total " (rtos DT)))
(princ "\nCommand is DIM-SUM to run again.\n")
(princ)
)

;; Runs automatically when loaded.
(c:dim-sum)


... and here is another request from a CADalyst reader. It seems that a number of third-party add-on packages for AutoCAD generate aund use their own layer names automatically. The problem arises when you upgrade to the next release; they are not always consistent in the layer naming between releases. It is worse when you shift to a package from a different vendor. For example, layer names WALL, ARCH-WALL, and AR-WALL become A-WALL.

You edit this program file directly to create the "from-to" layer list as the variable LL. When you load it, it automatically runs and searches the entire drawing for any objects on each "from" layer then changes them to the "to" layer. It fixes up model space, paper space, and block definitions.

When you are finished you can manually PURGE the drawing to get rid of the unused layers.

 

(princ "\nChange Layer utility.  Copyright by Bill Fane 19 Oct 99.\n")

;;  All rights reserved.  May not be sold for cash or traded for anything of value
;;  except for spare parts for a vintage Rolls-Royce.

;;  No warranty expressed or implied.  Make a backup copy of drawings before using.

;;  Modify the following Layer List (LL) to pair up layer names to change
;;  from -> to.  There must be a period with a space on each side between the names.
;;  Names are not case-sensitive.
;;  All objects on each "from" layer will be changed to the corresponding "to" layer.
;;  If any "to" layer does not exist it will be created.  Watch your typing.
;;  When you (load "C-L") it will run automatically.

(setq LL
'( ;; FROM       TO

("wall" . "a-wall")
("AR_wall" . "A-wAll")
("arch-wall" . "a-WALL")
)
)


(princ "\nChecking drawing object layers... ")
(setq C 0)
(foreach X LL
(setq
SS (ssget "X" (list (cons 8 (car X))))
N 0
)
(princ "\n   ")(princ (car X))
(if SS
(progn
(setq SSL (sslength SS))
(while (< N SSL)
(setq ED (entget (ssname SS N)))
(entmod
(subst (cons 8 (cdr X))
(assoc 8 ED) ED)
)
(setq N (1+ N)
C (1+ C)
)
)
)
)
)
(princ "\nChecking block definitions...")
(setq BL (tblnext "block" 1))
(while BL
(princ ".")
(setq BE (cdr (assoc -2 BL)))
(while BE
(setq ED (entget BE))
(if (setq EL (assoc 8 ED))
(progn
(setq EL (cdr EL))
(foreach X LL
(if (= EL (strcase (car X)))
(progn
(setq ED
      (subst (cons 8 (cdr X))
(assoc 8 ED) ED)
C (1+ C)
)
(entmod ED)
)
)
)
)
)
(setq BE (entnext BE))
)
(setq BL (tblnext "block"))
)
(princ (strcat "\nLayer name changed for " (itoa C) " objects.\n"))
(setq
LL nil
C nil
X nil
SS nil
N nil
SSL nil
ED nil
BL nil
BE nil
EL nil
)

(princ)


Enjoy!

Job opportunity:

CAD OPERATOR

Morrow Environmental Consultants Inc. (MECI) has an immediate opening in our Burnaby office for a CAD Operator.

 The successful applicant will have a relevant educational background (BCIT or equivalent),  1 - 2 years experience drafting for a natural resource firm, experience with AutoCAD 14 in a Windows '95 environment, and experience working with paper space, complex engineering drawings and site mapping.

 A high level of commitment to quality and the ability to work well both independently and within a team environment is required. 

 MECI offers a superior compensation package, a dynamic work environment and opportunity for career growth.  Forward your resume to:

Human Resources
MECI
5151 Canada Way
Burnaby BC
V5E 3N1
Fax: (604) 515 5150
Closing Date:  January 31, 2000

 We thank all applicants for their interest; however, only short listed candidates will be contacted, please no telephone calls. 


 

BCIT SCHOOL OF ENGINEERING

CAD/CAM STUDENT PROJECTS

December, 1999

 

The Program

The CAD/CAM (Computer Aided Design and Manufacturing) program at BCIT is a two-year diploma of technology program. In the first year of the program, students take courses in engineering fundamentals. These courses are common to all mechanical engineering options. In the second year, students in the CAD/CAM option concentrate on computer applications but continue to take courses in engineering design and manufacturing.  

CAD/CAM Projects Course

As part of the graduation requirements for the CAD/CAM program, students must undertake an industrial project. The project course runs from mid-January to mid-May, concurrent with the students’ final term of study. Since the students are in full time attendance at BCIT while they are working on their project, the project cannot be too large or have a restrictive schedule. The suggested size of the project is 120 hours, with students spending 6 to 8 hours per week on the project. Facilities and technical support for the projects are provided by BCIT. 
Project Overview

The type of project depends on the needs of the industry sponsor. Typically, students work towards providing solutions to industrial problems. Student projects are not designed to replace work that would normally be done in-house, but to tackle those problems are not being currently investigated. For smaller projects, the student can take the project from concept to completion. However, for larger projects, the student may either produce a portion of the project, a working prototype, or proof of concept for the entire project. Alternatively, two students may collaborate on a project if the depth and scope warrant it.

 Type of projects

As well as having basic engineering design and manufacturing skills, the students are familiar with a variety of software applications including AutoCAD, MicroStation, 3D Studio, MasterCAM, and Access as well as programming in AutoLISP, C++, and Visual Basic. Students are able to assist companies in the following areas:

 

Customisation of CAD software                       Application Programming

CAD Systems Management                             Systems and Needs Analysis

Engineering Software integration                       3D Animation and Rendering

Engineering Design                                           Manufacturing and CNC Programming

 

Below, describes typical projects in more detail.

 Costs

There is no charge to the company sponsoring the project. However, if specialized software or equipment is required, the sponsoring company may be asked to make a contribution.

 Technical Support

BCIT provides the facilities and technical support for the project. Generally, the sponsor would initially meet with the student to define problem to be solved, possible methods of solving the problem, and the overall scope. The student must complete a proposal and have the proposal approved before proceeding with the project. Once the project is underway, the amount of contact between the student and the sponsor is limited to information gathering, progress reports, and technical questions that relate directly to the project.

 Ownership and Disclosure

Generally, the student is the owner of any software, device, or any other tangible resource produced during the project. However, where the sponsor makes a significant contribution, alternate arrangements can be made. It is best that all issues regarding ownership be discussed and settled while the project is in the proposal stage.

 

It is also understandable that in certain situations, sponsors may ask the students to limit their disclosure of proprietary knowledge.

Limitations

As the students pursue these projects on a non-fee basis, there is no guarantee that the project will be completed and that it will meet the sponsor’s expectations. Since successful completion of a project is a requirement for graduation from the CAD/CAM program, the number of unsuccessful projects is quite small. Also, as there may be more projects proposed than there are students, or in the case that the proposed project does not meet the academic requirements of the program, there are no assurances that a project will proceed.

 

If you are interested in supporting a student project or have any questions regarding projects, please contact one of the instructors listed below.

            Brent Dunn

            Instructor, Mechanical Technology

            tel: 432-8755, fax: 431-8422, email: brent_dunn@bcit.ca

 

            Neil Munro

            Instructor, CAD/CAM Program

            tel: 453-4014, fax: 431-8422, email: neil_munro@bcit.ca

 

            British Columbia Institute of Technology

            Burnaby, BC


     TYPES OF PROJECTS

 

The following list describes typical types of projects that are undertaken by students in B.C.I.T.'s CAD/CAM program. The list is meant to give an idea of the range of projects that our students are capable of completing.

 

Drawing System Management  managing projects, drawing files, released drawings, revisions, archiving, backups; drawing databases; tracking time
Parametric Drawing  drawing items based on user supplied parameters or parameters stored in file/database
Systems/needs Analysis  analyzing current and future needs, recommending hardware and software.
Linking to External Database   using ACAD for a graphic front end to an external database file; bill of materials generation, facilities management.
Setup/general Customization creating menus, prototype drawings, setup programs, custom blocks, standards
Web Implementation 
  • automatically posting drawings and/or data to the websearchable databases and catalogs
  • performing drawing management
Drawing Translation   writing programs to convert from one drawing standard to another or to support data exchange between application.
CNC Programming 
  • AutoCAD/MasterCAM project to manufacture parts. 
  • toolpath verification.
General Programming   create AutoLISP, C++, ObjectARX, Visual Basic 

    

    EXAMPLE PROJECTS

 Drawing System Management:

 A company has recently converted to CAD.  Although they have only 50 - 60 drawings in total, they are already finding it difficult to find drawings on their computer.  In addition, they have lost released drawings and have had to recreate them from scratch.  They require a drawing management system to manage drawings for each project, keep track of revision histories, and archive released drawings and unused drawings to tape.

 Parametric Drawing:

 A company draws steel structural details in CAD.  They find that they place many of the same steel shapes over and over and realize that it would be efficient to have the steel shapes stored in a library.  Since shapes of one type have the same shape and just differ in size, they would like the shapes to be parametrized and the parameters for each size stored in an external file.  An AutoLISP is required routine to draw each shape parametrically from the information in the file.

Systems/Needs Analysis:

 A company is considering converting to a different CAD package or adding an add-on to their current package.  They require recommendations on hardware and software to meet current and future needs and economic justification for their senior management.  They also require initial training and setup.

 Setup/General Customization:

 A company has recently purchased AutoCAD for municipal drawings. They require prototype drawings, blocks for frequently used items (eg. manholes, connectors), and custom menus.

 Drawing Translation:

 A company wishes to use BC Government mapping data in AutoCAD.  The data comes from the government in the TRIM format.  The format is well documented (similar to AutoCAD's DXF file).  They require a "C" program to translate TRIM data into DXF or DWG format.

 CNC Programming:

 A company wishes to produce a series of wooden propellers.  They make the propellers by hand and wish to rough them out using a CNC machine.  They require a system which automatically produces a G-Code file given several parameters which define a propeller.

 C or Visual Basic Programming:

 A company is using several AutoLISP routines and are wondering if they might be better suited to ARX or Visual Basic.

 Linking to an External Database:

 An interior design company uses AutoCAD to place furniture in hotel floor plans as part of their interior design.  They manually extract furniture schedules information from plots of the finished drawings then enter the data into DBase to create reports for clients.  They require a set of attributed furniture blocks that can be automatically extracted to a DBase file and linked to a second DBase file containing the manufacturer's data on each piece of furniture. They also require custom DBase reports to report total cost for each floor, room, supplier, etc.

Paul Backus
The President’s Report
PC Support Center -- http://www.pcsupport.com/

Here is an interesting website I chanced upon recently. They offer many services and some of them are free. Companies and individuals alike will want to check out the following “freebies”.

Backup service: - archive up to 25 MB of data online at no charge - free restoration via the web (or purchase a CD-ROM)

Technical Support: - answer simple questions, or really tough ones - email or live assistance - technical support forums - advice on software updates - the ability to download updates – fast and often free

Other services such as software and hardware have costs to consider. These can be checked out at their website, http://www.pcsupport.com/member
/backupcenter_pricelist.asp
.

Consider the inconvenience or outright panic incurred by a lost, stolen or damaged notebook computer when you are counting on it for a presentation. Now you can back up a mirror image of your hard drive and have the data and a replacement laptop in your possession within 24 hours. Would this be a valuable service to you or your company?

Is this another variation of the theme of using online programs and storage versus the stand alone PC station? Is there any possibility that such a system would allow access of sensitive information to third parties willing to use it to their advantage? If you trust the bank to store your money and prevent others from accessing it, you would feel confident with a system that must recognize access codes unique to each end-user. Combined with encryption of data, clients should feel comfortable with security levels.

Off-site data storage must be secure and easy to use. Would it be feasible to have your own computer backup system that could be accessed through an ISP? The economics of the task will probably determine the outcome for this issue. The above company certainly is on to a good idea with a tax deductible monthly payment that offers a mobile service convenient to large populations.

      Paul Backus

Minutes of the January 5th VAUS meeting – B.C.I.T., Burnaby

Several Tips for R2000 were covered at the meeting. “PROXYNOTICE” was the command most appreciated. Drafters wishing to avoid the proxy dialogue box that appears when R14 opens a drawing that originated from R2000 must set this variable to “0”. Open the drawing, breeze by the warning, type in the command, set it to the correct value, then close the drawing and reopen it. Voila, no more complaints from the client about this annoying dialogue box.

Another tip was the use of templates to save a layout (Paperspace) setting for future drawings. After setting up a layout in R2000, SAVEAS to a template file. This automatically saves the file in the Template folder with a .dwt extension. All settings for your plot are saved, including the border/title block. In a new drawing, a new layout tab will be created by right-clicking on any tab and choosing “From template…”. Browse for the desired layout in the correct .tmp files offered. If you prefer an alternate method, use the Design Center to do the work.

Don’t forget about the power of Grips for doing quick jobs. They are useful for moving attributes around in your border/title block. After activating object grips, right click anywhere on screen and hold down while moving the mouse. This action will move the chosen objects to their new location.

Frank Zander introduced RTEXT/Diesel tools where the source of the text can be the value of a Diesel expression or an ASCII file. With an external file, the text behaves like an XREF, but can be edited with the “RTEDIT” command.

Creating a Date Stamp – Using the above mentioned tools, we discovered how to generate a Date Stamp for drawing identification. It automatically creates a date and time marking for the border of your drawing.

Creating an Xref Stamp – Looking for a quick way of determining how many X-Refs are in your drawing? We also covered a method for generating a list of all X-Refs which would show in the border of the drawing for future reference.

Some other useful tips from Frank: http://www.autodesk.com/support
/autocad/util2000.htm
-- for a Plotstamp program from Autodesk http://www.autodesk.com/support
/autocad/patch2000.htm
-- for AutoCAD 2000 updates

Are you looking for data management tools to work within your company’s network. Rob Cheek from Seagate Software was giving away free CD’s of their Seagate Analysis program. It will run ad hoc queries, analyse OLAP cubes, and design reports for you. The CD also included their Seagate Info 7 software that will give you the infrastructure to manage and distribute information efficiently across your entire company. A free test version of the above, for up to 50 users in your company, is available on their website: www.fetchseagate.com/register.

The second half of the meeting contained a demonstration of 4.0 by Bill Fane. This parametric program is the electronic equivalent of drawing on a napkin. Mechanical Desktop can be used as a 2D drafting tool that translates into 3D design effortlessly. Or the designer can go to straight 3D to create their model and also take advantage of the parametric tools available within the program. Lines within 3 degrees of horizontal or vertical will be drawn like R2000 with Ortho left On.

The intricate 3D model shown was constructed by Bill in less than an hour. He designed it within that time while compiling lecture notes. We looked at individual parts, a complete image, and an exploded view of the same 3D model. Part outlines, dimensioning, hatching, center lines, etc. were automatically put on the correct layer. Dimensioning was done with one command. Drawing notations could be inserted in any one of 17 languages. Order the Power Pack and you would have access to half a million pre-drawn parts such as; fasteners, bearings, rings, and seals. 8,000 standard details and 20,000 std. holes are also included. As usual, we were treated to an amazing display of software capability by a very competent designer. Thanks, Bill.



Clarification: Transfer of License Policy

Autodesk has always had a non-transferable license agreement, but has allowed limited exceptions to this policy to maximize customer satisfaction. Due to the online auction sites on the Internet, a "used-license" market has emerged and requests for license transfers and serial number inquiries from customers have mushroomed. It was never Autodesk's intent to have this level of transfer, nor to have a used license market. Therefore, we are changing our exception policy to no longer allow transfers of license between individuals or separate companies. The only transfers that will be allowed will be in the case of companies who are merging or being acquired by another company. These will essentially be "name changes" and not transfers of license. We will also do away with our policy of requiring customers to upgrade to the current revision of the product in order to make a transfer. This change will be effective on Monday, May 31, 1999. For transfer of license requests, called the Autodesk Customer Service Center at 1-800-538-6401, and follow prompts for general customer service. The CSC will be able to help you determine if you qualify under the new guidelines.

 

 

An Architectural building Design Firm in the Lower Mainland is for sale, along with a client base, goodwill and AutoCAD R13 software. Please contact lee@dowco.com if you are interested. One of the few ways to transfer a license of AutoCAD.

 

 

 

 

 

 

 

 

 

Interested in taking CAD courses?

B.C.I.T. -- Bill Fane www.atc.bcit.ca Email: atc@bcit.ca 432-8828 431-8422 (fax)

Kwantlen University College -- John Sprung www.kwantlen.bc.ca Email: johnsp@kwantlen.bc.ca 599-2945 599-2902 (fax)

 

     
FREE Drawing Viewer at: http://www.contractcaddgroup.com/download/DrawingViewer.htm
  • View up to 16 AutoCAD drawings on one sheet.
  • View an unlimited amount of drawings in any directory.
  • Large zoom view of selected drawing.
  • Switch directories and drives to view AutoCAD r13, r14 or 2000 drawings.
  • Retrieve/display Drawing Properties information.
  • Support for Windows Explorer SendTo.
  • Insert drawings as blocks or Xrefs.
  • Open drawings directly from the viewer into AutoCAD r14 or 2000.

FREE WARE complements of Frank Zander at Contract CADD Group

 

Using the Diesel Macro Language

By: Frank Zander

Diesel is an acronym for Direct Interpretively Evaluated String Expression Language. Diesel is a macro language for altering the AutoCAD status line (with the MODEMACRO system variable), customizing menu items, and Rtext objects.

MODEMACRO

MODEMACRO is an AutoCAD system variable (and an AutoCAD command to access the MODEMACRO system variable).  The MODEMACRO variable information is displayed in the Status area in AutoCAD (typically directly below the command prompt line). 

 

When working with drawings that have long layer names, I sometimes find that not enough room is provided in the AutoCAD layer pull down list box. 

To display the current layer below the command prompt use the Diesel expression: $(getvar,clayer).  This Diesel expression gets (using getvar) the current layer (clayer) variable in the current drawing.  To display the current layer in the Status area do the following:

  1. From the AutoCAD command prompt type: MODEMACRO
  2. Type: Current Layer = $(getvar,clayer)
  3. Press Enter
  4. Change the current layer from the Layer list box
  5. Note status area now contains the current AutoCAD layer.

Warning!

Unhandled Exception error using MODEMACRO
AutoCAD 2000 will terminate unexpectedly with an "Unhandled Exception" error when a MODEMACRO string is assigned that accesses the current database (such as the DIESEL expression "$(getvar,clayer)" in Multiple Document Interface mode, and a new document window is created using the NEW or OPEN command.

This error occurs because the DIESEL interpreter is "dereferencing" a NULL pointer without checking its value. This problem exists in AutoCAD 2000 (T.0.98) and Architectural Desktop 2.0 (T.1.07).

The workaround to this problem is to use the modemacro ARX file from Autodesk. modemacro.arx implements an AcApDocManagerReactor that temporarily sets MODEMACRO to "" while the drawing loads, then resets MODEMACRO to the original value once the load is complete. To obtain modemacro.arx, download the 41113.zip file from the Autodesk Patches and Maintenance Releases Web site at http://www.autodesk.com/support/autocad/patch2000.htm

 

To return the status are off type MODEMACRO (enter) . (enter)

 To have AutoCAD display the current command in the status area use MODEMACRO with $(getvar,cmdnames)

 

[../../meeting/2000/February2000.htm]

 

Contract CADD Group
Specializing in personal or corporate CADD instruction, customization and technical support.

Instruction in:

  • Inventor & SolidWorks
  • AutoCAD 2002

Off site facilities available for personal (up to two students) or corporate (up to twelve students) training.

CADD customization using:

  • AutoLisp.
  • Visual Basic for Applications (VBA)
  • Menus and Macros.

Technical support:

  • On site
  • Distance via phone or internet

For more information:

 

 

[../../executive/executive1999-2000.htm]
Summer School for CAD professionals! To be held in Kelowna, B.C. May 10th - 13th, 2000 in association with Okanagan University College. Watch here for more complete information to be posted in January.
 

ikclogo.gif (7315 bytes)

Celebrating 10 years in Business, Island Key computer provides Full Turnkey Solutions for Autodesk products. We carry and support:

Software: AutoCAD, Mechanical Desktop, Architectural Desktop, Land Development Desktop, 3D studio Viz, Genius software, AutoCAD Map, Actrix.

Hardware: Plotters, Printers, Monitors, Digitizers, and Computer Systems

Training: Wide range of training courses offered in Classroom style or Individual

Networking: Windows NT, Windows or Novell

 

Vancouver 669-8178 www.islandkey.com Victoria: 380-6465

211 - 938 Howe Street, Vancouver, BC. V6Z 1N9. Tel: 669-8178, Fax: 669-8179
109 - 561 Johnson Street, Victoria, BC. V8W 1M2. Tel: 380-6465, Fax: 380-6488

 

 

Contribute to CADvisory online by sending your article to: webmaster@vaus.bc.ca
VAUS executive members can contribute directly to CADvisory online by clicking here