TheSwamp

CAD Forums => CAD General => Topic started by: jonesy on October 18, 2005, 07:45:04 AM

Title: Snap From Endpoint
Post by: jonesy on October 18, 2005, 07:45:04 AM
Hi Guys,

How would/could I automate the "Snap From" and "Endpoint" into  a 1 key press shortcut?

Many thanks

T :-)
Title: Re: Snap From Endpoint
Post by: M-dub on October 18, 2005, 08:23:46 AM
How's this for starters  ;)  :evil:
Title: Re: Snap From Endpoint
Post by: jonesy on October 18, 2005, 08:36:30 AM
Oooh, why didnt I think of using them...

Actually mine dont look like that, why do mine look like this 
                                 (http://www.theswamp.org/screens/jonesy/snaps.jpg) :lmao:
Title: Re: Snap From Endpoint
Post by: M-dub on October 18, 2005, 08:46:18 AM
I don't know if I've ever used that toolbar.  I either type 'em, shift+right click or keep them running.  :)
Title: Re: Snap From Endpoint
Post by: jonesy on October 18, 2005, 08:49:37 AM
Thats one toolbar thats always (since the dawn of toolbars) been on my screen.
Title: Re: Snap From Endpoint
Post by: M-dub on October 18, 2005, 09:30:57 AM
Another way to do it using running Osnaps is just to make sure you have the snaps you use most often turned on, but toggle osnap with F3.  That's what I do because I don't like having the running Osnap turned on very often.
Title: Re: Snap From Endpoint
Post by: Kerry on October 18, 2005, 10:00:44 AM
Ask Chuck Gabriel about his Hotkeys ..
Title: Re: Snap From Endpoint
Post by: jonesy on October 18, 2005, 10:01:36 AM
Methinks I need to explain what I have to do on a regular basis.

I have a sheet of over 100 cross sections dumped from MX. They spit them out in one big block, but to get them to look right in the drawing frame each has to be a certain distance from the edge of the other, we usually get 12 to a drawing frame.

Currently I select a section, pick and endpoint, then pick snap from, then pick another endpoint and type the required distance it is needed to be away from the last section (if you understand what I'm trying to say, or is a diagram needed?)

Many thanks
T :-)
Title: Re: Snap From Endpoint
Post by: whdjr on October 18, 2005, 10:54:32 AM
diagram please. :-)
Title: Re: Snap From Endpoint
Post by: M-dub on October 18, 2005, 10:57:57 AM
diagram please. :-)

I have to agree :)
Title: Re: Snap From Endpoint
Post by: MP on October 18, 2005, 11:03:42 AM
I think she means she has this --

Code: [Select]
+---+---+---+
|   |   |   |
+---+---+---+
|   |   |   |
+---+---+---+
|   |   |   |
+---+---+---+

But wants this --

Code: [Select]
+---+  +---+  +---+
|   |  |   |  |   |
+---+  +---+  +---+

+---+  +---+  +---+
|   |  |   |  |   |
+---+  +---+  +---+
 
+---+  +---+  +---+
|   |  |   |  |   |
+---+  +---+  +---+

Apologies for the crude graphics.
Title: Re: Snap From Endpoint
Post by: whdjr on October 18, 2005, 11:08:01 AM
Still don't see how that correlates with her description.(not trying to disrespect your drafting abilities MP)
Title: Re: Snap From Endpoint
Post by: jonesy on October 18, 2005, 11:08:45 AM
Something like that MP. I'll screen dump a before and after when I get into work in the morning.
Title: Re: Snap From Endpoint
Post by: MP on October 18, 2005, 11:11:33 AM
Still don't see how that correlates with her description.(not trying to disrespect your drafting abilities MP)

Drafting abilities, bwaaa, nasal thrusted coffee!

Anyway, I think the move command using the displacement option would be the fastest way to do it.
Title: Re: Snap From Endpoint
Post by: jonesy on October 18, 2005, 11:20:11 AM
Not so simple I'm afraid (or am I mistaken), the last block of sections I worked on were 14 sections horizontally and 18 sections vertically, I can only get 3 horizontally and 4 vertically on a drawing frame, and the sections are not individual blocks they are lines, and text.

No, a diagram/thinned out drawing maybe the answer.

Many thanks
T :-)
Title: Re: Snap From Endpoint
Post by: jonesy on October 19, 2005, 04:30:54 AM
Please excuse my images - dont know how to make them smaller :oops:
Before(http://www.theswamp.org/screens/jonesy/before.jpg)

After (http://www.theswamp.org/screens/jonesy/After.jpg)

This is becomeing a bigger part of my drawing schedule, so anyway of speeding it up would be VERY welcome

I will try to put the actual drawings in the lilly pond if time allows.

Mucho Gracias

T :-)
Title: Re: Snap From Endpoint
Post by: Kerry on October 19, 2005, 04:39:59 AM
Hi Tracey


I may have some spare time this evening

Title: Re: Snap From Endpoint
Post by: Kerry on October 19, 2005, 04:41:33 AM
How about using a marker  that has been arrayed rectangular on a Locked NoPlot Layer ??
Title: Re: Snap From Endpoint
Post by: jonesy on October 19, 2005, 05:07:52 AM
Hi Tracey

  • Copying or moving ?
  • Blocks or just Entities ?
  • Is the 6'.0 and 4'.0 a product of Dimscale ? or fixed
  • Vanilla Acad acxxxx ?

I may have some spare time this evening



Kerry, I always leave the MX file in tact and copy the info into a new template, so moving the sections would be fine.

All the items are entities (usually proxy entities so I have to explode them to get them to do anything)

The 6 and 4 are usually fixed unless it is a wide road then there maybe different numbers involved

We use vanilla acad 2004

We work in Metric

How about using a marker that has been arrayed rectangular on a Locked NoPlot Layer ??
Sorry, I'm not following you there. Could you please explain in Dumb Blonde English

If you are interested there are now 2 zip files in the lilly-pond
http://www.theswamp.org/lilly_pond/jonesy/13403-4500-43%20rev%20a%20sections.zip and
http://www.theswamp.org/lilly_pond/jonesy/design3%20cross%20sections.zip
- Mark I will delete them soon as they are quite big
The drawings show the before and after including layer name changes etc. I know there must be an easier way of doing this

Many Thanks
T :-)
Title: Re: Snap From Endpoint
Post by: Kerry on October 19, 2005, 05:21:31 AM
Rectangular array

using a circle as the BtmLeft of each table on a no-plot locked <after arrayed> layer

Just thought it would/could be a quick and nasty solution.

Set you snap to END and CENTER [ OSMODE 5 ]
Title: Re: Snap From Endpoint
Post by: Kerry on October 19, 2005, 04:20:22 PM
Can you make do with the array Tracey, or do you need a program to help ?
Title: Re: Snap From Endpoint
Post by: jonesy on October 20, 2005, 03:26:19 AM
Hi Kerry, thanks for your help so far.

I wish I could make it with an array, but i have 3 columns that are 4 spaced and then there is a column that is 6 spaced (to allow for the paper border in layout mode).

I really am having a block with this, I know there must be a quicker way of doing this, but what I cannot fathom.

Many thanks
Title: Re: Snap From Endpoint
Post by: Kerry on October 20, 2005, 03:51:22 AM
ahhhh, ok

See if this helps .. A layout solution may be more appropriate than a programatic one.

add the setout lines to your ModelSpace layouts to layer z-vpfr which is currently locked and nonplot
perhaps change the color of the new lines < or change the layer > for clarity.

... .. then just move the tables to the intersections ; no FROM required.




Title: Re: Snap From Endpoint
Post by: Kerry on October 20, 2005, 04:03:22 AM
Hi Tracy
Regarding your Automated Layer changing etc ..

Perhaps the best way to handle the problem is one step at a time. < sounds simple, heh >

Write out a FULL list of changes you want made.
not a HOW list, but a WHAT list, stating explicitly what you want changed or what problem needs solving.

The most expedient solution may be in using a sequence of simple toolbar commands rather than a full blown program ; at least initially untill the problem is resolved technically.
Title: Re: Snap From Endpoint
Post by: Kerry on October 20, 2005, 04:30:45 AM
Tracey,
Couple of questions :

Is your Template setout < setout grid > the same from job to job, or at least within a job. ?

Do you insert the MASTER cross sections into your Modelspace to arrange them ?

I think I could semi-automate the arrangement process to take less than 2 seconds per frame, about 12 minutes for the 500+ frames, irrespective of the Master setout shape.

[edit : projected time revised ]
Title: Re: Snap From Endpoint
Post by: Kerry on October 20, 2005, 04:38:00 AM
I assume your chainage will not always start with 0.00

I assume the chainage will not always be 10.0 increments.

I assume the frame will have a consistant bounding box.

Are you exploding the frame before you move it ?
Title: Re: Snap From Endpoint
Post by: jonesy on October 20, 2005, 05:48:07 AM
I assume your chainage will not always start with 0.00

I assume the chainage will not always be 10.0 increments.

I assume the frame will have a consistant bounding box.

Are you exploding the frame before you move it ?

Chainage start numbers can vary, Chainages are usually 10.0 increments, but not always.

The frame will have the same size bounding box per job, this may vary from job to job though.

Currently I am exploding before moving, but I am open to new ideas. I have 2 zip files in the lillypond, the design cross sections file is exactly how I receive it from the surveyor. The frame is not 1 entity, but lots of proxy entities :x

Many thanks for your help
T :-)
Title: Re: Snap From Endpoint
Post by: Kerry on October 20, 2005, 06:02:36 AM
OK, TRY this

Code: [Select]
(defun c:TJ990 (/               FrameBoundingHeight
                FrameBoundingWidth              Workpoint
                MovePoint       LL              UR
                ss
               )
  (setq FrameBoundingHeight 12.0
        FrameBoundingWidth 20.0
  )
  (setvar "OSMODE" 32)                                      ; INTersection
  (while
    (and (setq Workpoint
                (getpoint
                  "\n Move Frame FROM :\n Select Frame Lower Left Corner"
                )
         )
         (setq
           Movepoint (getpoint
                       "\n Move Frame TO :\n Select NEW Lower Left Corner"
                     )
         )
    )
     (setq LL (mapcar '- Workpoint '(0.5 1.0 0))
           UR (mapcar '+ Workpoint (List FrameBoundingWidth FrameBoundingHeight 0))
           ss (ssget "c" LL UR)
     )
     (vl-cmdf "MOVE" ss "" WorkPoint MovePoint)
  )
  (setvar "OSMODE" 0)
)

Title: Re: Snap From Endpoint
Post by: Kerry on October 20, 2005, 06:09:48 AM
You may need to amend this to suit the Project,

Code: [Select]
  (setq FrameBoundingHeight 12.0
        FrameBoundingWidth 20.0
  )

but you will never have to select the frame to Move it. :)

 
Title: Re: Snap From Endpoint
Post by: jonesy on October 20, 2005, 06:22:13 AM
I like it ALOT.

I dont even need to do the grid, just use osnap and polar works great.

But I will try setting up a grid for when the engineers change the things yet again (meeting this afternoon, pdfs sent, and awaiting comments)

Thanks Kerry, you are a STAR

T :-)
Title: Re: Snap From Endpoint
Post by: Kerry on October 20, 2005, 06:25:00 AM
no, no ,no, no,  :)

Just do a grid, Trust me .. even if its temporary. You will be happier.
Title: Re: Snap From Endpoint
Post by: jonesy on October 20, 2005, 06:34:03 AM
Okie Dokie, done a grid, saved as a wblock, hidden away from prying eyes.

Thanks again Kerry

T :-)
Title: Re: Snap From Endpoint
Post by: Kerry on October 20, 2005, 06:38:52 AM
:) Great.

Next :

What editing do you need to Automate ?

Title: Re: Snap From Endpoint
Post by: jonesy on October 20, 2005, 07:10:23 AM
Holy moley, where do I start.

You may need to re-order these to make it automate properly.

1. Find any proxy objects and explode them to native ACAD objects.
2. Find all text and change it to a clients standard, font style is already set-up in the drawing template file.
3. All items that are red need to be on a layer(and to make things confusing the white vertical lines outside the "box" need to be on the same layer.) I can let you know the layer/linetype/lineweight info if/when you need it.
4. All items that are green need to be on a layer, again I can let you know the details.
5. All the white frames need to be on a layer of their own
6. All the text that is either the "level datum" or the "chainage = " needs to be on another layer
7. Everything needs to be BYLAYER

I think thats everything I have to do to them.

Mucho Gracias
T :-)
Title: Re: Snap From Endpoint
Post by: Kerry on October 20, 2005, 09:07:12 AM
Tracey,

How are you currently producing the incline Ratio Text ?

The Original Sections Table seem to have additional text in the 'existing' fields on the right of the table.
Can that be retained. ?

Can the layers in the 2 samples you posted be used as a suitable guide for required changes to layer/linetype/lineweight/Text Style
I discovered a gotcha .. dont try to explode ALL the tables at once   :oops:
Title: Re: Snap From Endpoint
Post by: Kerry on October 20, 2005, 12:06:11 PM
Tracey, I'm about half way through the code to make all the changes.

.. but I'm brain dead, so going for a couple of hours sleep.

Tell your boss I will do all his future translation jobs on contract for $0.50 each.  [ shhhh .. It's fast ]  :lol:
Title: Re: Snap From Endpoint
Post by: jonesy on October 20, 2005, 12:12:19 PM
Thanks Kerry


Have a great sleep, dont think about the coding please!

T :-)
Title: Re: Snap From Endpoint
Post by: Kerry on October 20, 2005, 04:48:32 PM
Give this a run Tracey ..

.. does the 520 odd Tables in about 20 seconds. .. so in conjunction with the other routine you should be able to find some free time.

It was a little easier than I anticipated.

I think I have caught everything, but check the output initially.

Just yell if you have issues.

I didn't bother with error trapping 'cause I think you'd save before and after running this, so ....
Code: [Select]
(prompt "\n SuperDuper SectionTable modifier for Jonesy.\n Type TJ880 at the commandLine to start")

(defun c:TJ880 (/
                ;; Functions
                ProcessPoly     ProcessMText    sset->vlalist
                ;; Variables
                MTextStyle      LayerExisting   LayerText
                LayerFrame      oName           TJ-KAHUNA
               )
  (setq MTextStyle    "oxford standard"
        LayerExisting "C-LEVL-EXTG"
        LayerProposed "C-LEVL-PROP"
        LayerText     "C-LEVL-TEXT"
        LayerFrame    "C-LEVL-FRAM"
  )
  ;;
  ;; KWB @ The Swamp 20051021
  ;;
  ;; ----------------------
  (defun ProcessMText (oMText / oMTextTrueColor oMTextTextString index)
    (setq oMTextTrueColor  (vla-get-colorindex (vla-get-truecolor oMText))
          oMTextTextString (vla-get-textstring oMText)
    )
    (vla-put-stylename oMText MTextStyle)
    (vla-put-color oMText acbylayer)
    (cond
      ((setq index (vl-string-search "Proposed Levels" oMTextTextString))
       (vla-put-textstring oMText
                           (vl-string-subst "PROPOSED LEVELS"
                                            "Proposed Levels"
                                            oMTextTextString
                                            index
                           )
       )
       (vla-put-layer oMText LayerProposed)
      )
      ((setq index (vl-string-search "Proposed Offset" oMTextTextString))
       (vla-put-textstring oMText
                           (vl-string-subst "PROPOSED OFFSET"
                                            "Proposed Offset"
                                            oMTextTextString
                                            index
                           )
       )
       (vla-put-layer oMText LayerProposed)
      )
      ((setq index (vl-string-search "Proposed Width" oMTextTextString))
       (vla-put-textstring oMText
                           (vl-string-subst "PROPOSED WIDTH"
                                            "Proposed Width"
                                            oMTextTextString
                                            index
                           )
       )
       (vla-put-layer oMText LayerProposed)
      )
      ;;
      ((setq index (vl-string-search "Existing Levels" oMTextTextString))
       (vla-put-textstring oMText
                           (vl-string-subst "EXISTING LEVELS"
                                            "Existing Levels"
                                            oMTextTextString
                                            index
                           )
       )
       (vla-put-layer oMText LayerExisting)
      )
      ((setq index (vl-string-search "Existing Offset" oMTextTextString))
       (vla-put-textstring oMText
                           (vl-string-subst "EXISTING OFFSET"
                                            "Existing Offset"
                                            oMTextTextString
                                            index
                           )
       )
       (vla-put-layer oMText LayerExisting)
      )
      ;;
      ((vl-string-search "Level Datum" oMTextTextString)
       (vla-put-layer oMText LayerText)
      )
      ((vl-string-search "Chainage" oMTextTextString)
       (vla-put-layer oMText LayerText)
      )
      ;;
      ;; Numbers
      ;;
      ((= oMTextTrueColor acred) (vla-put-layer oMText LayerProposed))
      ((= oMTextTrueColor acgreen) (vla-put-layer oMText LayerExisting))
    )
    (princ)
  )
  ;; ----------------------
  (defun ProcessPoly (oPoly / oPolyLength oPolyTrueColor)
    (setq oPolyTrueColor (vla-get-colorindex (vla-get-truecolor oPoly))
          oPolyLength    (vla-get-length oPoly)
    )
    (cond ((= oPolyTrueColor acred)
           (vla-put-layer oPoly LayerProposed)
           (vla-put-color oPoly acbylayer)
           ;; To Do :
           ;; add the incline Text
           ;;
          )
          ((= oPolyTrueColor acgreen)
           (vla-put-layer oPoly LayerExisting)
           (vla-put-color oPoly acbylayer)
          )
          ((or (> oPolyLength 15) (equal oPolyLength 0.100 0.01))
           ;; rectangles or markers ..
           (vla-put-layer oPoly LayerFrame)
           (vla-put-color oPoly acbylayer)
          )
          (t
           (vla-put-layer oPoly LayerProposed)
           (vla-put-color oPoly acbylayer)
          )
    )
  )
  ;; ----------------------
  ;; ----------------------
  (defun sset->vlalist (sset / index ReturnValue)
    (setq index (if sset
                  (1- (sslength sset))
                  -1
                )
    )
    (while (>= index 0)
      (setq ReturnValue (cons (vlax-ename->vla-object (ssname sset index))
                              ReturnValue
                        )
            index       (1- index)
      )
    )
    ReturnValue
  )
  ;; ----------------------
  ;;
  ;; Main ------------------
  ;;
  ;; Make a selection of the Tables ..
  ;;
  (prompt "\n Select Frames to modify.")
  (setq TJ-kahuna (sset->vlalist (ssget)))
  ;;
  ;; Do the mojo
  ;;
  (foreach item TJ-kahuna
    ;; (setq tmp item)
    (cond ((= (vla-get-objectname item) "AcDbPolyline") (ProcessPoly item))
          ((= (vla-get-objectname item) "AcDbMText") (ProcessMText item))
    )
  )
  (princ)
)
(princ)
Title: Re: Snap From Endpoint
Post by: jonesy on October 21, 2005, 05:13:49 AM
Hi Kerry,

Thanks for all the effort you put in. I may be having a blonde day, but I cannot get the routine to change anything.

Is it because they come up as MXACSTRINGs on my puter?

If so how do I get round this?
Title: Re: Snap From Endpoint
Post by: Kerry on October 21, 2005, 05:20:23 AM
Have you exploded the proxies ?

I exploded them 1 column at a time then inserted the lot into your Template Drawing, then ran the changer on the lot.

I used AC2005.
Title: Re: Snap From Endpoint
Post by: jonesy on October 21, 2005, 06:09:05 AM
Hi Kerry, this is what I do/get


Code: [Select]
Opening an AutoCAD 2000 format file.
Regenerating model.

AutoCAD Express Tools Copyright © 2002-2003 Autodesk, Inc.

AutoCAD menu utilities loaded.
Command: Specify opposite corner:
Command:
Command:
Command: _explode 286 found

Command: Specify opposite corner:
Command:
Command: *Cancel*

Command:
Command: (LOAD "C:/tracey/personal stuff/programs/change chainages.lsp")
 SuperDuper SectionTable modifier for Jonesy.
 Type TJ880 at the commandLine to start

Command: tj880

 Select Frames to modify.
Select objects: Specify opposite corner: 1338 found

Select objects:
; error: Automation Error. Key not found

Command:

I have to save my files as 2000 type, but I have also tried it as 2004 format, and still the same :cry:

Am I doing something wrong?

Many thanks
T :-)
Title: Re: Snap From Endpoint
Post by: Kerry on October 21, 2005, 06:14:55 AM
Can you email the zipped DWG file to me  .. address in PM.
Title: Re: Snap From Endpoint
Post by: Kerry on October 21, 2005, 08:47:42 AM
Tracey,

Looks like we need a revised set of rules.

I'll wait till you get it sorted.
The potential savings are too big to let this die.

You have mail. :)

Title: Re: Snap From Endpoint
Post by: jonesy on October 21, 2005, 09:23:29 AM
Thanks Kerry

Right Back at YA!

T :-)
Title: Re: Snap From Endpoint
Post by: t-bear on October 21, 2005, 10:09:14 AM
OK you two.....get a ROOM or something!  Sheeeesh!  :lmao: :lmao:
Title: Re: Snap From Endpoint
Post by: Kerry on October 21, 2005, 10:58:32 AM
Tracey,

Do you want Text or Mtext in your details ?

If Mtext, do you want the  monotxt.shx override maintained.
If Mtext, do you want the  0.75 TextWidth override maintained.

Style for 0.4 Text   [ and/or Mtext ]
Style for 0.2 Text   [ and/or Mtext ]  Note it is 1.8 H is some design dwgs 2.0 in others ?

Do you want the labels converted to uppercase ?

Title: Re: Snap From Endpoint
Post by: Kerry on October 21, 2005, 11:25:58 AM
OK you two.....get a ROOM or something! Sheeeesh!

Your meaning eludes me. ?

Title: Re: Snap From Endpoint
Post by: jonesy on October 21, 2005, 11:39:02 AM
Poor Mr Bear, did you want to join in the fun!


Kerry, the font should print out as the client standard, which would be either Romand or arial depending on the client, and the height should be 2. The labels, uppercase would be nice, but not essential!

Many thanks
T :-)
Title: Re: Snap From Endpoint
Post by: Kerry on October 21, 2005, 07:16:28 PM
This is worse that pulling teeth ..  :?

Unless you say otherwise :

Text will be used .. Mtext will be converted.
Style will be "oxford standard" [ currently defined using romand.shx ]
Width scale factor  will be changed from 0.75 to 1.0
0.18 High Text will be changed to 0.2  High and the insert point moved Y -0.2
Table label Text will be changed to uppercase.

Can you resolve these. .. may need to email the .shx files
Quote
Substituting [isocp.shx] for [Babtie].
Substituting [isocp.shx] for [Mark 1].

mapping.shx required
civil.shx required
Title: Re: Snap From Endpoint
Post by: jonesy on October 24, 2005, 03:14:21 AM
Kerry, sorry about the delay. (I thought I'd e-mailed you the details)
The Babtie and Mark 1, I dont know why they are in there! It may be something to do with the translation from MX.

I will e-mail the mapping and civil shx files to your e-mail address.

Many thanks for your time

Tracey
Title: Re: Snap From Endpoint
Post by: Kerry on October 24, 2005, 05:09:22 AM
Got them Tracey.

I'll have another look after I have dinner.

Title: Re: Snap From Endpoint
Post by: Kerry on October 24, 2005, 05:41:44 AM
Tracey,
You'll need to explode the "ACAD_PROXY_ENTITY" then explode the "MTEXT"

I used QSELECT quite sucessfully, selecting a column at a time. you should be left with LWPOLYLINE and TEXT only.

Insert the exploded design sections into your Template drawing.

Convert using TJ880.

Relocate using TJ990.

Code: [Select]
(prompt
  "\n SuperDuper SectionTable modifier for Jonesy.[build 2.0]\n Type TJ880 at the commandLine to start"
)

(defun c:TJ880 (/
                ;; Functions
                ProcessPoly     ProcessText    sset->vlalist
                ;; Variables
                TextStyle      LayerExisting   LayerText
                LayerFrame      oName           TJ-KAHUNA
               )
  (setq TextStyle    "oxford standard"
        LayerExisting "C-LEVL-EXTG"
        LayerProposed "C-LEVL-PROP"
        LayerText     "C-LEVL-TEXT"
        LayerFrame    "C-LEVL-FRAM"
  )
  ;;
  ;; KWB @ The Swamp 20051024
  ;;
  ;; ----------------------
  (defun ProcessText (oText / oTextTrueColor oTextString)

    ;;
    (if (equal 0.18 (vla-get-height oText) 0.005)
      (vla-put-height oText 0.20)
    )
    ;;
    (if (equal (/ pi 2) (vla-get-rotation oText) 0.0005)
      (vla-put-insertionpoint
        oText
        (vlax-3d-point
          (mapcar '-
                  (vlax-safearray->list
                    (vlax-variant-value (vla-get-insertionpoint oText))
                  )
                  '(0.0 0.2 0.0)
          )
        )
      )
    )
   
    ;;
    (vla-put-textstring oText (strcase (vla-get-textstring oText)))

    ;;
    (setq oTextTrueColor (vla-get-colorindex (vla-get-truecolor oText))
          oTextString    (vla-get-textstring oText)
    )
   
    ;;
    (cond ((vl-string-search "LEVEL DATUM" oTextString)
           (vla-put-layer oText LayerText)
          )
          ;;
          ((vl-string-search "CHAINAGE" oTextString)
           (vla-put-layer oText LayerText)
          )
          ;;         
          ((= oTextTrueColor acred) (vla-put-layer oText LayerProposed))
          ((= oTextTrueColor acgreen) (vla-put-layer oText LayerExisting))
    )
    (vla-put-stylename oText TextStyle)   
    (vla-put-ScaleFactor oText 1.0)
    (vla-put-color oText acbylayer)
   
    (princ)
  )
  ;; ----------------------
  (defun ProcessPoly (oPoly / oPolyLength oPolyTrueColor)
    (setq oPolyTrueColor (vla-get-colorindex (vla-get-truecolor oPoly))
          oPolyLength    (vla-get-length oPoly)
    )
    (cond ((= oPolyTrueColor acred)
           (vla-put-layer oPoly LayerProposed)
           (vla-put-color oPoly acbylayer)
           ;; To Do :
           ;; add the incline Text
           ;;
          )
          ((= oPolyTrueColor acgreen)
           (vla-put-layer oPoly LayerExisting)
           (vla-put-color oPoly acbylayer)
          )
          ((or (> oPolyLength 15) (equal oPolyLength 0.100 0.01))
           ;; rectangles or markers ..
           (vla-put-layer oPoly LayerFrame)
           (vla-put-color oPoly acbylayer)
          )
          (t
           (vla-put-layer oPoly LayerProposed)
           (vla-put-color oPoly acbylayer)
          )
    )
  )
  ;; ----------------------
  ;; ----------------------
  (defun sset->vlalist (sset / index ReturnValue)
    (setq index (if sset
                  (1- (sslength sset))
                  -1
                )
    )
    (while (>= index 0)
      (setq ReturnValue (cons (vlax-ename->vla-object (ssname sset index))
                              ReturnValue
                        )
            index       (1- index)
      )
    )
    ReturnValue
  )
  ;;
  ;; Main ------------------
  ;;
  ;; Make a selection of the Tables .. saved in TJ-kahuna
  ;;
  (prompt "\n Select Frames to modify.")
  (setq TJ-kahuna (sset->vlalist (ssget)))
  ;;
  ;; Do the mojo
  ;;
  (foreach item TJ-kahuna
    ;; (setq tmp item)
    (cond ((= (vla-get-objectname item) "AcDbPolyline") (ProcessPoly item))
          ((= (vla-get-objectname item) "AcDbText") (ProcessText item))
    )
  ) 
  (princ)
)
(princ)
Title: Re: Snap From Endpoint
Post by: jonesy on October 24, 2005, 06:06:51 AM
WOW

Thank you very much Kerry, it works great, and will save mucho time = more swamp time.


Many thanks

Tracey
Title: Re: Snap From Endpoint
Post by: t-bear on October 24, 2005, 09:24:59 AM
Good looking bit of coding there Kerry!  I especially like the commenting......
"Do the Mojo"?  :-o
"TJ-kahuna"??  :roll:
Sweeeet!! :-D :-D

Have fun there, "TJ"............................
Title: Re: Snap From Endpoint
Post by: jonesy on October 24, 2005, 09:27:38 AM
Thanks T-Bear, now I CAN have some fun instead of pulling my hair out every time there is a design change!
Title: Re: Snap From Endpoint
Post by: Kerry on October 24, 2005, 04:10:23 PM
....... I especially like the commenting......

It's probably just as well most of my code isn't public, some of it DOES have frivolous comments.

Yep, that was fun Ted. No need for pages of assertion testing and error testing.

.. and knowing how much time it would save Tracey was icing on the cake, so to speak.
Title: Re: Snap From Endpoint
Post by: jonesy on October 25, 2005, 03:35:53 AM
Glad you enjoyed yourself Kerry!

Thanks again for the files. Cant wait to start using it in on the next scheme.

Catch you later

T :-)
Title: Re: Snap From Endpoint
Post by: jonesy on November 01, 2005, 05:51:57 AM
Kerry,


THANK YOU, THANK YOU, THANK YOU!

I have just used your routines (the design changed yet again on the 44 drawing sheet scheme I originally whined here about.

Start to finish (with a bit of "talking time") it took around about 1 hour, instead of the nearly 30 hours the first batch took.

Once again, thanks for your help

Tracey :-)
Title: Re: Snap From Endpoint
Post by: Kerry on November 01, 2005, 06:33:17 PM
<SatisfiedSigh.wav>
Title: Re: Snap From Endpoint
Post by: MP on November 01, 2005, 06:39:54 PM
Well done Kerry. I had offered to help our fair friend, but you beat me to it, so I begged off, knowing you'd write an outstanding solution.
Title: Re: Snap From Endpoint
Post by: Kerry on November 28, 2006, 06:16:49 PM
I was making some notes about the software design evolution process and this came to mind ...

just wondered if it's still in use ?


Title: Re: Snap From Endpoint
Post by: jonesy on November 29, 2006, 01:45:07 AM
I have had no need to use it in the past 6 months. We have had no contracts recently where cross sections were used :-( but rest assured it WILL be used when we get another big job through the door. It is just too big a time saver to not use.
Title: Re: Snap From Endpoint
Post by: Kerry on November 29, 2006, 02:33:56 AM
good, thanks Tracey.
Title: Re: Snap From Endpoint
Post by: Glenn R on November 29, 2006, 09:21:10 AM
Tracey,

We soooo have to talk we I get there. Here, this is done on the MX side with very little effort - your lads are just being lazy.
I would receive a shirtload of dwg files from the mexers that had the correct number of sections per sheet for a prticular title block. Then a program of mine would grab all those and create new dwg files, with each mx x-sect attached as an xref, doing this all in memory, so it literally took seconds for hundreds of x-sect plans.

Beauty of this is that the mexers couls just rerun their outputs, and as long as the dwg files were the same name ( and still had the same of xsects per sheet), the dwg files would just auto-magically update. If the number of cross section sheets changed, just re-run my program...no biggy either way.

I will read this thread in it's entirety tomorrow to get a better understanding, but I think you get my point from above.

Cheers,
Glenn.
Title: Re: Snap From Endpoint
Post by: jonesy on November 29, 2006, 09:35:31 AM
Tracey,

We soooo have to talk we I get there. Here, this is done on the MX side with very little effort - your lads are just being lazy.
Either lazy, or not enough knowledge. Theres a major shortage of MX people... I wish I could learn to use it, but they wont let me near the program :-( (dispite me asking )
I would receive a shirtload of dwg files from the mexers that had the correct number of sections per sheet for a prticular title block. Then a program of mine would grab all those and create new dwg files, with each mx x-sect attached as an xref, doing this all in memory, so it literally took seconds for hundreds of x-sect plans.

Beauty of this is that the mexers couls just rerun their outputs, and as long as the dwg files were the same name ( and still had the same of xsects per sheet), the dwg files would just auto-magically update. If the number of cross section sheets changed, just re-run my program...no biggy either way.
That sounds great. The main problem here is that the MX bods we have here, all work in different ways, and their way is best, and there seems to be no standards set. In the past it has been a MAJOR pain. When the next big job rolls through the door we are gonna be in deep doo-doo again, with me tidying up at the cad end.
I will read this thread in it's entirety tomorrow to get a better understanding, but I think you get my point from above.

Cheers,
Glenn.
Thanks Glenn. It'd be great if I could tell the MX bods what I want to receive, and not just accept any old rubbish. (but sound like I know what I'm talking about :oops:)
Title: Re: Snap From Endpoint
Post by: Glenn R on December 05, 2006, 09:54:42 PM
Tracey,

I spoke with an MXer yesterday, and he said it was just a macro containing input commands. Essentially, he tells it the sheet size and MX figures out how many xsects per sheet and dumps them out to separate dwg files.

Cheers,
Glenn.
Title: Re: Snap From Endpoint
Post by: jonesy on December 06, 2006, 01:45:44 AM
Thanks Glenn, I'll make a note and talk to them next time I have to work on a job with sections.