Author Topic: xref layer problem  (Read 4358 times)

0 Members and 1 Guest are viewing this topic.

diarmuid

  • Bull Frog
  • Posts: 417
xref layer problem
« on: May 05, 2005, 07:25:52 AM »
I have a problem with an xref.

We use an xref called “site-1”.  This xref is stored on another server in our sister office 200miles away.  We are doing the civil’s etc for the job and our sistercompany is doing pretty much everything else.  My problem begins when we use “their” xref.  We really need to use only 10 layers or so on their model file.  So we xref the file in and freeze the information that we don’t want.  Because of the nature of the job, new layers are being added every hour.  The effects us because every couple of hours or so we need to switch off the layers that come in as “new” layers.  Is there a short way to solve this problem, this problem repeats itself in about 10 of our drawings, but the layers we need to see are the same in the other 10 drawings.  I thought about a lisp, which can be done, but is there another better way?

thanks

Diarmuid
If you want to win something run the 100m, if you want to experience something run a marathon

whdjr

  • Guest
xref layer problem
« Reply #1 on: May 05, 2005, 07:44:55 AM »
That my friend is a conundrum that plagues us all that work on multi-person projects.  You might be able to use the Layer Manager to set up a Layerstate that only shows the layers you want visible, but that still is a very manual process.

Sorry I'm not much help.  :(

hyposmurf

  • Guest
xref layer problem
« Reply #2 on: May 05, 2005, 07:46:41 AM »
Now about VISRETAIN?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
xref layer problem
« Reply #3 on: May 05, 2005, 08:25:30 AM »
Warning: I just woke up, this may not be as coherent as it should be.

A better way than lisp, I dunno VB? :)

Personally I'd do it in lisp, and it's mostly trivial. Rather than an automatic routine (read reactor based, which imo is always a last resort) this would be demand based (driven by user), though the drudgery bits would be taken care of for the user.

The only thing the user would have to do is --

(1) Run routine1: Take a snapshot of the current layer status of all xrefs (save status to a dictionary), and

(2) On demand, run routine2: Reload all xrefs, restore the xref layer status per the snap shot data and turn off any layers that don't exist in the snapshot data.

If one were really ambitious you could loosely follow the layer manager paradigm: mulitiple (named) snapshots or "return points". This of course would not be the trivial version.

Wow, do I ever need coffee this morning.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

CADaver

  • Guest
xref layer problem
« Reply #4 on: May 05, 2005, 09:32:38 AM »
Quote from: MP
Warning: I just woke up, this may not be as coherent as it should be.
normal morning, eh?

Quote from: MP
The only thing the user would have to do is --
(1) Run routine1: Take a snapshot of the current layer status of all xrefs (save status to a dictionary), and
oh boy, opportunity to learn something.  how do i do this?  flesh me out a little on this part.

Quote from: MP
(2) On demand, run routine2: Reload all xrefs, restore the xref layer status per the snap shot data and turn off any layers that don't exist in the snapshot data.
if i can figure out step one, i might beable to do this one myself.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
xref layer problem
« Reply #5 on: May 05, 2005, 09:36:24 AM »
re: "Normal morning". He he, but not so much. The mornings following nights I take sleeping pills I feel like I've been wacked upside the head with a mallet. Last night was one such a night.

re: How do I do this? I'll write something up for you as soon as I can.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

CADaver

  • Guest
xref layer problem
« Reply #6 on: May 05, 2005, 09:49:15 AM »
to get to sleep, i have a little "cocktail" the doc cooked up for me that dulls the pain enough i can sleep, but i can still function in the morning.

no hurry on the routine, i'm just curious about capturing the layer data and saving it to a dictionary.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
xref layer problem
« Reply #7 on: May 05, 2005, 10:42:48 AM »
mmm, cocktails.

Hey it's my pleasure RC, as is the standing offer to contribute (somehow) towards the automation or configuration of the vr software you use.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

CottageCGirl

  • Guest
Re: xref layer problem
« Reply #8 on: May 05, 2005, 10:45:23 AM »
Quote from: diarmuid
I have a problem with an xref.

 We are doing the civil’s etc for the job and our sistercompany is doing pretty much everything else.  
Diarmuid


If this is an on going issue, as a matter of policy, could your sister rename the layers you need like " Civil-column" and "Civil-demo" so that when you bring up the layer manager, they are all blocked togeather or are there other parties envlolved?

CADaver

  • Guest
xref layer problem
« Reply #9 on: May 05, 2005, 12:01:57 PM »
Quote from: MP
mmm, cocktails.

Hey it's my pleasure RC, as is the standing offer to contribute (somehow) towards the automation or configuration of the vr software you use.
thanks, my big brother is a real computer geek (true savant, can build a computer with bailing wire and chewing gum, but can't tie shoe laces) and has worked with dragon before for his sister-in-law.  I asked him to look into working something out for me, but thanks a lot for the offer, though.  

he and i were less than friendly for many years over some silly thing or another until i finally swallowed my pride, and understood my unforgiveness hurt me in many ways.  now, i seek out ways to contact him and get him involved in my life and family.  when i asked him to help me out in this, you'd have thought i gave him a new car or something.  he sent me email this AM that he's already got dragon in the loop and we might do a conference call tomorrow.

my typing is getting a little better, but you may have noticed, i gave up on the shift key.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
xref layer problem
« Reply #10 on: May 05, 2005, 12:07:01 PM »
Quote from: CADaver
thanks, my big brother is a real computer geek (true savant, can build a computer with bailing wire and chewing gum, but can't tie shoe laces) and has worked with dragon before for his sister-in-law.  I asked him to look into working something out for me, but thanks a lot for the offer, though.  

he and i were less than friendly for many years over some silly thing or another until i finally swallowed my pride, and understood my unforgiveness hurt me in many ways.  now, i seek out ways to contact him and get him involved in my life and family.  when i asked him to help me out in this, you'd have thought i gave him a new car or something.  he sent me email this AM that he's already got dragon in the loop and we might do a conference call tomorrow.

my typing is getting a little better, but you may have noticed, i gave up on the shift key.

great testimonial randy, thank you for sharing it. inspirational here for a few folks i'm sure, including me.

thanks for not shouting too.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

diarmuid

  • Bull Frog
  • Posts: 417
Re: xref layer problem
« Reply #11 on: May 05, 2005, 12:35:05 PM »
Quote from: CottageCGirl
Quote from: diarmuid
I have a problem with an xref.

 We are doing the civil’s etc for the job and our sistercompany is doing pretty much everything else.  
Diarmuid


If this is an on going issue, as a matter of policy, could your sister rename the layers you need like " Civil-column" and "Civil-demo" so that when you bring up the layer manager, they are all blocked togeather or are there other parties envlolved?


i hear you, put we are the same company, but with another office, they have some civil people doing some work as well on the drawings.

so, we basically have to use the same systems, with no divergence, and i have to say that i agree with the policy for once.

so it looks like its going to be the lisp route so.

thanks for the input guys/girls
If you want to win something run the 100m, if you want to experience something run a marathon

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
xref layer problem
« Reply #12 on: May 05, 2005, 01:46:27 PM »
have you thought about a simple script file?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

CADaver

  • Guest
xref layer problem
« Reply #13 on: May 05, 2005, 05:59:14 PM »
Quote from: CmdrDuh
have you thought about a simple script file?
That does... ...what?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
xref layer problem
« Reply #14 on: May 05, 2005, 10:40:44 PM »
So questions for you guys ...

There are a number of ways this can be written.

First:

Tasks common to all methods:

Code: [Select]
CMD1:
• Save "data" to some form of persistant container, likely a dictionary.
• In our simple scheme any previous data that may have existed is discarded.

CMD2 (ini):
• Save visretain setting.
• Force visretain to on.
• Reload xrefs.

CMD2 (end):
• Restore original visretain setting.

Method 1:

Code: [Select]
CMD1:
• Save list of xref layers.

CMD2:
• CMD2 (ini)
• Iterate thru all xref layers, turning any layer off that doesn't exist in the saved data.
• CMD2 (end)

Pros:
• Very easy to implement.

Cons:
• If user renames any xrefs between execution of CMD1 and CMD2 *poof*, all layers in the renamed xrefs will be turned off.

Method 2:

Code: [Select]
CMD1:
• Store the ObjectID or handle of each xref.
• For each xref collect and store the ObjectID or handle of each layer, linking to parent XREF objectID.

CMD2:
• CMD2 (ini)
• Iterate thru all xref layers, turning any layer off that doesn't have an entry in the stored data.
• CMD2 (end)

Pros:
• Unphased by renamed xrefs.
• Layers renamed within an xref will still be recognized.

Cons:
• If an xref is detached and subsequently reloaded the ObjectID / handle will change, the net result being the program will "forget" the settings for said xref.

Method 3:

Code: [Select]
CMD1:
• Store the path of each xref.
• For each xref collect and store the ObjectID or handle of each layer, linking to parent XREF path.

CMD2:
• CMD2 (ini)
• Iterate thru all xref layers, turning any layer off that doesn't have an entry in the stored data.
• CMD2 (end)

Pros:
• Unphased by renamed xrefs.
• Layers renamed within an xref will still be recognized.

Cons:
• You cannot have more than one xref block per path. That is, you cannot have XREF1, XREF2 and XREF3 point to the same path. Many folks do this so the same information can be represented differently in different viewports.

So ... whcih one should I pursue?

Notwithstanding what I offered above, maybe you have a better idea. Share please.

The ball is now in your court.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

CADaver

  • Guest
xref layer problem
« Reply #15 on: May 06, 2005, 10:36:38 AM »
because we regularly rename reference files, and we sometimes have the file referenced with different names, it seems that your method 2 would be my choice.  it's only drawback is detaching a file loses it's info and that is more than acceptable performance for our uses.

but before your run off and write a whole program, could you maybe break it up in manageable pieces and step through so that I (we) can learn a little something along the way?  i understand that may be more time consuming on your end, and if so nevermind, it was just a thought.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
xref layer problem
« Reply #16 on: May 06, 2005, 11:05:29 AM »
Thanks for the input Randy.

I'll write it the way I attempt to write the majority of my apps that are not quick one offs --

• Identify and code all the functions required to solved the problem; each function does exactly one thing and no more.
• Name functions and variables so they are self documenting.
• Call defined functionality so that problem is solved; this is usually via a function named 'main'.
• Add comments as required so that others might understand the overall process.*

Hope that will suffice.

* I don't comment things like "This is a loop ...". IMO those kind of comments serve only to litter up source code and actually drive me nuts.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

CADaver

  • Guest
xref layer problem
« Reply #17 on: May 06, 2005, 01:08:36 PM »
Quote from: MP
Thanks for the input Randy.

Hope that will suffice.
whatever you do, it will be considerably more than i have now, thanks for the effort.

t-bear

  • Guest
xref layer problem
« Reply #18 on: May 06, 2005, 10:26:49 PM »
I've been using this for a while now.  When you have new layers that you want to freeze, run this routine, select a vport with the "bad" layers,then pick the objects on that layer....bingo! frozen in all vports.  Not *totally* automatic, but close.......
Code: [Select]
;Will freeze selected layers in ALL vports, you pick 'em, they're chilled!
;Thanks to the "gurus" at CADalog forums for this routine...3/7/03
;Keith, Trev, Hendie & Paul
;
;
(defun c:vplfrz   ()
  (setvar "TileMode" 0) ;  Force PaperSpace
  (setq vpFlag (getvar "cvport"))
  (if (= vpFlag 1)
    (progn
      (setq sel-vpt 1)
      (setq sel-vport (car (entsel "\nSelect view port: ")))
      (if (= sel-vport nil)
   (progn
     (alert "You must select a viewport\nTry again!")
     (c:vplfrz)
   )
   (progn
     (setq entvport (entget sel-vport))
     (if (= (cdr (assoc 0 entvport)) "VIEWPORT")
       (frz-vplayer)
       (progn
         (alert "You must select a viewport\nTry again!")
         (c:vplfrz)
       )
     )
   )
      )
    ); else Viewport is already selected
    (frz-vplayer)
  ) ;endif (= vpFlag 1)
)

(defun frz-vplayer ()
  (setq   e2    (entget sel-vport)
   viewport (cdr (assoc 69 e2))
  )
  (command "mspace")
  (setvar "cvport" viewport)
  (setq loop "")
  (while loop
    (setq
      pik (nentsel "\nSelect an item on XREF to Freeze: ESC to Exit:")
    )

    (cond
      ((/= pik nil)
       (setq lay (assoc 8 (entget (car pik))))
       (setq str (cdr lay))
       (command "vplayer" "f" str "All" "") ; Freeze in ALL viewports
      )
      ((= pik nil)
       (alert "Nothing Selected!\nTry Again!")
       (frz-vplayer)
      )
    )
  ) ; End while
  (command "pspace")
  (princ)
)

(prompt "\nType VPLFRZ to run")
(prin1)

Don't know how helpful it'll be, but maybe it can be "tweaked" to do what it doesn't, if it doesn't do what you want/need.......

hudster

  • Gator
  • Posts: 2848
xref layer problem
« Reply #19 on: May 08, 2005, 07:02:22 AM »
If the layer names you need aren't going to change you could easily write a script to do this for you.

Just assign it to a macro button and away you go.

Code: [Select]
-layer;freeze;*;;
-layer;thaw;layer1;
thaw;layer2;
thaw;layer3;
etc etc
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
xref layer problem
« Reply #20 on: May 09, 2005, 12:37:46 AM »
Status update: Managed to write 3/4 of the functions tonight. Gonna call it quits early with a melatonin or two in attempt to get a good sleep tonight. Should have a finished program per "method 2" tomorrow or tuesday. Over and out.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst