Author Topic: Snap From Endpoint  (Read 9562 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Snap From Endpoint
« Reply #30 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.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: Snap From Endpoint
« Reply #31 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 :-)
Thanks for explaining the word "many" to me, it means a lot.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Snap From Endpoint
« Reply #32 on: October 20, 2005, 06:38:52 AM »
:) Great.

Next :

What editing do you need to Automate ?

  • 1.
  • 2.
  • 3.
  • etc.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: Snap From Endpoint
« Reply #33 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 :-)
Thanks for explaining the word "many" to me, it means a lot.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Snap From Endpoint
« Reply #34 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:
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Snap From Endpoint
« Reply #35 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:
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: Snap From Endpoint
« Reply #36 on: October 20, 2005, 12:12:19 PM »
Thanks Kerry


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

T :-)
Thanks for explaining the word "many" to me, it means a lot.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Snap From Endpoint
« Reply #37 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)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: Snap From Endpoint
« Reply #38 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?
Thanks for explaining the word "many" to me, it means a lot.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Snap From Endpoint
« Reply #39 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.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: Snap From Endpoint
« Reply #40 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 :-)
Thanks for explaining the word "many" to me, it means a lot.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Snap From Endpoint
« Reply #41 on: October 21, 2005, 06:14:55 AM »
Can you email the zipped DWG file to me  .. address in PM.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Snap From Endpoint
« Reply #42 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. :)

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: Snap From Endpoint
« Reply #43 on: October 21, 2005, 09:23:29 AM »
Thanks Kerry

Right Back at YA!

T :-)
Thanks for explaining the word "many" to me, it means a lot.

t-bear

  • Guest
Re: Snap From Endpoint
« Reply #44 on: October 21, 2005, 10:09:14 AM »
OK you two.....get a ROOM or something!  Sheeeesh!  :lmao: :lmao: