Results 1 to 5 of 5

Thread: Routine that takes pairs of coordinates from a CMM and generates a blank part outline

  1. #1
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Question Routine that takes pairs of coordinates from a CMM and generates a blank part outline

    Anyone have a routine that can take pairs of cordinates from a CMM and
    generate an outline of a blanked part?

    I've got 10 pages of X,Y,Z cordinates and I am hoping to make
    a profile.

  2. #2
    Login to Give a bone
    0

    Lightbulb Re: Routine that takes pairs of coordinates from a CMM and generates a blank part outline

    Robert,
    If the CMM can output to a text file I can help you write something to read it in AutoLISP, and draw polylines or lines in AutoCAD. Please paste in a few lines of the file so I can get an idea of what format it is in.

    Terry Cadd

  3. #3
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Routine that takes pairs of coordinates from a CMM and generates a blank part outline

    Code:
    DIM LOC7= LOCATION OF POINT PT1
    AX   NOMINAL     +TOL       -TOL       MEAS        DEV      OUTTOL   
    X       1.019      2.000      2.000     -0.317     -1.336      0.000 -#-------
    Y       1.745      2.000      2.000      2.525      0.780      0.000 ------#--
    Z       1.057      2.000      2.000      1.057      0.000      0.000 ----#----
    T       0.000      2.000      2.000      1.547      1.547      0.000 -------#-
    I have this as a notepad file and an excel file.
    I am guessing that I would have to reformat the data in
    order to use it in a routine. I have 10 pages of points.
    Reordering the data for a routine would still be easier than plotting
    each point.

  4. #4
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Routine that takes pairs of coordinates from a CMM and generates a blank part outline

    Here is the file. I removed quite a few of the points so that I could
    meet the attachment limitation.
    Attached Files Attached Files

  5. #5
    Login to Give a bone
    0

    Post Re: Routine that takes pairs of coordinates from a CMM and generates a blank part outline

    Robert,
    Run the attached CMM program in a new drawing from the Model tab, and change to the layer you want to use. I've also attached my WordList program which is perfect for processing these types of text files.

    Terry Cadd

    Code:
    ;-------------------------------------------------------------------------------
    ; c:CMM - Draws a polyline connecting the points of a CMM file
    ;-------------------------------------------------------------------------------
    (defun c:CMM (/ Filename% First Line1@ Line2@ Line3@ Text$)
      (if (not *CMMFilename$)(setq *CMMFilename$ ""))
      (setq *CMMFilename$ (getfiled "Select CMM file to Process" *CMMFilename$ "txt" 2))
      (if (not *CMMFilename$)(exit))
      (setq Filename% (open *CMMFilename$ "r"))
      (setq First t Line2@ (list "") Line3@ (list ""))
      (while (setq Text$ (read-line FileName%))
        (setq Line1@ Line2@ Line2@ Line3@)
        (setq Line3@ (Wordlist Text$))
        (if (and (= (nth 0 Line1@) "X")(= (nth 0 Line2@) "Y")(= (nth 0 Line3@) "Z"))
          (if First
            (progn
              (setq First nil)
              (command "PLINE" (list (atof (nth 1 Line1@))(atof (nth 1 Line2@))(atof (nth 1 Line3@))))
            );progn
            (command (list (atof (nth 1 Line1@))(atof (nth 1 Line2@))(atof (nth 1 Line3@))))
          );if
        );if
      );while
      (close Filename%)
      (command "")
      (command "ZOOM" "E")
      (princ)
    );defun c:CMM
    ;-------------------------------------------------------------------------------
    ; WordList - Returns a list of words in a sentence
    ; Arguments: 1
    ;   Sentence$ = String to convert into a list strings
    ; Syntax: (WordList "Words in a sentence") = (list "Words" "in" "a" "sentence")
    ; Returns: List of words or strings that were seperated by spaces in a sentence
    ;-------------------------------------------------------------------------------
    (defun WordList (Sentence$ / Cnt# Item$ Mid$ Num# ReturnList@)
      (setq Cnt# 1 Num# 1)
      (repeat (strlen Sentence$)
        (setq Mid$ (substr Sentence$ Cnt# 1))
        (if (= Mid$ " ")
          (progn
            (setq Item$ (substr Sentence$ Num# (- Cnt# Num#)))
            (if (/= Item$ "")
              (setq ReturnList@ (append ReturnList@ (list Item$)))
            );if
            (setq Num# (1+ Cnt#))
          );progn
        );if
        (setq Cnt# (1+ Cnt#))
      );repeat
      (if (not ReturnList@)
        (setq ReturnList@ (list Sentence$))
        (if (/= (substr Sentence$ Num#) "")
          (setq ReturnList@ (append ReturnList@ (list (substr Sentence$ Num#))))
        );if
      );if
      ReturnList@
    );defun WordList
    ;-------------------------------------------------------------------------------
    Last edited by Terry Cadd; 2006-08-09 at 04:57 PM. Reason: [CODE] tags added

Similar Threads

  1. Replies: 0
    Last Post: 2014-11-14, 02:14 AM
  2. Replies: 0
    Last Post: 2013-07-14, 08:23 PM
  3. Replies: 5
    Last Post: 2010-09-24, 05:55 PM
  4. Coordinates and Coordination Part 2
    By wcaramella in forum Revit Architecture - General
    Replies: 0
    Last Post: 2010-03-23, 07:21 PM
  5. Replies: 5
    Last Post: 2006-09-01, 03:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •