Symbol / Coding Issue

Discussion of MicroSurvey CAD related issues and questions.

Moderators: Brian Sloman, Jason Poitras, James Johnston

Symbol / Coding Issue

Postby getrsurveyed » Thu Oct 28, 2010 4:26 am

I have always used a numeric coding system and have it set up with the Automap Library which is great..
sorts everything out to specific layers with the correct symbol. We are doing some cemetery work and
have been locating existing graves and I made a code (200) to plot the Gravestone symbol I created but
I also need the last name ... so the code typed in the field would be "200 Jones" and this works fine to
plot the symbol and with the "plot exact description" turned on .. it also plots the name. Trouble is I have
to edit each one to remove the 200 from the front of each name..

Kinda long winded but has anybody had something similar where you can get the symbol plotted along with
the following text .. without the code showing ?? Is this something that could be solved with a Lisp script ?

Steven
getrsurveyed
 
Posts: 49
Joined: Fri Nov 04, 2005 1:59 pm
Location: Cambridge Oh

Re: Symbol / Coding Issue

Postby Brian Sloman » Thu Oct 28, 2010 9:09 am

Hi, I have a lisp routine that you can use to remove the "200 " from the start of selected text in your drawing. This does not interface with the coordinate database at all so the database will still contain the full description like "200 Jones" and so if you do something like Rescale Complete Drawing, the "200 " part will come back. Hope this helps!

Code: Select all
(princ "\nLoading CHOPTEXT.LSP...")
;chop specified characters from beginning/end of selected text
(defun C:CHOPTEXT (/ ent entg txt pat1 pat2)

  (setq pat1 "200 ") ;text pattern to chop from start of text entity
  (setq pat2 "")     ;text pattern to chop from end of text entity

  (while (setq ent (car (entsel "\nSelect text to chop: ")))
    (setq entg (entget ent))
    (if (= (cdr (assoc 0 entg)) "TEXT")
      (progn
        (setq txt (cdr (assoc 1 entg)))
        (if (and (>= (strlen txt) (+ (strlen pat1) (strlen pat2)))
                 (= pat1 (substr txt 1 (strlen pat1)))
                 (= pat2 (substr txt (1+ (- (strlen txt) (strlen pat2))))) )

          (progn
            (setq txt (substr txt (1+ (strlen pat1)) (- (strlen txt) (+ (strlen pat1) (strlen pat2)))))
            (princ txt)
            (setq entg (subst (cons 1 txt) (assoc 1 entg) entg))
            (entmod entg)
          )
        )
      )
    )
  )
  (princ)
)
(princ "\nCommand -> CHOPTEXT")
(princ)
Brian Sloman
Development Manager
MicroSurvey Software Inc.
User avatar
Brian Sloman
Product Manager
 
Posts: 399
Joined: Fri Jan 07, 2005 4:42 pm
Location: Westbank, BC, Canada

Re: Symbol / Coding Issue

Postby getrsurveyed » Thu Oct 28, 2010 10:54 am

Thanks Brian .. I thought LISP may be the answer .. I'll give it a try

Steven
getrsurveyed
 
Posts: 49
Joined: Fri Nov 04, 2005 1:59 pm
Location: Cambridge Oh

Re: Symbol / Coding Issue

Postby getrsurveyed » Thu Oct 28, 2010 12:40 pm

Brian... That works great but... I also need to add two spaces after removing the "200" code
so the name does not lay over the symbol. I've hacked around with your script but with no success
as I am not familiar with LISP (VB yes). I can see that keeping track of parentheses would be tough
without a program interface. Function names are not very intuitive... car ??
If you get a chance ..

Thanks, Steven
getrsurveyed
 
Posts: 49
Joined: Fri Nov 04, 2005 1:59 pm
Location: Cambridge Oh

Re: Symbol / Coding Issue

Postby getrsurveyed » Sat Oct 30, 2010 10:33 am

DOH !! I figuered it out ... just add two more spaces when typing in code in the field..
then you're lisp script works perfectly 8) Thanks Brian !

Steven
getrsurveyed
 
Posts: 49
Joined: Fri Nov 04, 2005 1:59 pm
Location: Cambridge Oh

Re: Symbol / Coding Issue

Postby Brian Sloman » Mon Nov 01, 2010 9:09 am

Hi, New in the MSCAD 2010 10.2.0 version you can specify an X and/or Y offset for any of the labels using the AutoMap Library - so in this case, you can set an X offset in your "200*" entry to offset the description say 1 or 2 units (measured in multiples of the text height) to slide the labels over. This way you don't need to code the extra spaces in the field.
Brian Sloman
Development Manager
MicroSurvey Software Inc.
User avatar
Brian Sloman
Product Manager
 
Posts: 399
Joined: Fri Jan 07, 2005 4:42 pm
Location: Westbank, BC, Canada

Re: Symbol / Coding Issue

Postby getrsurveyed » Tue Nov 02, 2010 10:59 am

Brian, I just loaded up the new version last week and I have been after them to add this placement feature since 2005.. its great and enables me to not have all the point numbers clustered on top of each other when multiple points are the same or nearly so.
That works great for this also by setting it over 2 I don't have to add the extra spaces. Awesome !

You really got me started on this Lisp thing .. I've heard about it for years but never dug in to see what it was about. I started programming in the early '80's about when the Comodore and the HP-41 came out and wrote complete COGO programs for both back then but since then mostly involved with VB. Anyways I worte my first Lisp prog last weekend to automate something I do in Intellicad all the time .. no error checking yet but it works. Nit-picking your example and with the help files in Intellicad I've been able to start to get grip on it. Whole new way of thinking compared to VB ... more like assembly language.

Keep up the good work and Thanks, Steven
getrsurveyed
 
Posts: 49
Joined: Fri Nov 04, 2005 1:59 pm
Location: Cambridge Oh


Return to MicroSurvey CAD

Who is online

Users browsing this forum: No registered users and 1 guest