Author Topic: What would you want in a set of Xref tools?  (Read 24478 times)

0 Members and 1 Guest are viewing this topic.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: What would you want in a set of Xref tools?
« Reply #30 on: April 01, 2011, 03:02:19 PM »
I'll think about these.  I want something that is generic, but can be used my a lot of people.  Once you start getting too specific, then it looses functionality in that sense.

Just thinking out loud right now, but I guess it something like this was to happen ( barc, krush ), then a file would need to be setup, so the command would know what to do.  Not saying I'm going to do it, but just thinking how it would be done.

@Rabbit:

I have a lisp like that also, and use it all the time still.  Might be a good thing to copy over to the suite.  Didn't even think about that code.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

GDF

  • Water Moccasin
  • Posts: 2081
Re: What would you want in a set of Xref tools?
« Reply #31 on: April 01, 2011, 03:54:47 PM »
A tool that sets the layer before attaching and xref.

Do it with a reactor, this is just for the xref command:

Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; VLR_COMMAND.lsp courtesy Peter Jamtgaard 2003

;;; Vlr Command is a function that will switch the active layer in a drawing.
;;; The reactor checks the command that is starting and if it recognizes it
;;; it will switch to a specified layer. If the layer doesn't exist it will
;;; create it with the color, linetype, and plottable setting provided.
;;; To load and run this program add the lines (load "vlr_command")(c:vlr_command)
;;; to your acaddoc.lsp or another autoloading lisp routine.

(defun VLR_COMMANDXREF-IT ()
  (vl-load-com)
  (vlr-command-reactor nil '((:vlr-commandWillStart . startCommandxref))) 
  (vlr-command-reactor nil '((:vlr-commandEnded . endCommandxref)))
  (vlr-command-reactor nil '((:vlr-commandCancelled . cancelCommandxref)))
  (vlr-editor-reactor nil '((:vlr-commandwillstart . ARCH:COMXREF1))) 
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ARCH:COMXREF1 (CALL CALLBACK / COMLAYLST)
;;; List of corrusponding      commands layers  color linetype     plottable
  (setq COMLAYLST
         (list
              (list "XREF" "0-XREF" 7 "continuous" :vlax-true)
         )
  )
  (foreach
         N COMLAYLST
    (if (= (strcase (car CALLBACK)) (strcase (car N)))
      (progn
        (make_layers
          (cadr N)
          (caddr N)
          (cadddr N)
          (car (cddddr N))
        )
        (setq n1 n)
        (vla-put-activelayer
          (vla-get-activedocument
            (vlax-get-acad-object)
          )
          (vlax-ename->vla-object
            (tblobjname "LAYER" (cadr N))
          )
        )
      )
    )
  ) 
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Make layers using activeX
(defun MAKE_LAYERS (LAY_NAM COLOR LTYPE PLOTL / LAYOBJ LAYSOBJ LTYPESOBJ)
  (setq CDWGOBJ (vla-get-activedocument
                  (vlax-get-acad-object)
                )
        LAYSOBJ (vla-get-layers CDWGOBJ)
  )
  (if (not (tblobjname "layer" LAY_NAM))
    (vl-catch-all-error-p
      (vl-catch-all-apply 'vla-add (list LAYSOBJ LAY_NAM))
    )
  )
  (setq LAYOBJ (vla-item LAYSOBJ LAY_NAM))
  (if (not (tblobjname "ltype" LTYPE))
    (progn
      (setq LTYPESOBJ (vla-get-linetypes CDWGOBJ))
      (vla-load LTYPESOBJ LTYPE (findfile "acad.lin"))
      (vlax-release-object LTYPESOBJ)
    )
  )
  (vla-put-layeron LAYOBJ :vlax-true)
  (if (/= (strcase (vla-get-name LAYOBJ)) (strcase (getvar "clayer")))
    (vla-put-freeze LAYOBJ :vlax-false)
  )
  (vla-put-lock LAYOBJ :vlax-false)
  (vla-put-color LAYOBJ COLOR)
  (vla-put-linetype LAYOBJ LTYPE)
  (vla-put-plottable LAYOBJ PLOTL) 
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;Kenny Ramage @ afralisp.com
(defun startCommandxref (calling-reactor
                     startCommandxrefInfo
                     /
                     thecommandstart
                    )       
  (setq OldLayer (getvar "CLAYER")) 
  ;;(vlr-editor-reactor nil '((:vlr-commandwillstart . ARCH:COMXREF1)))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun endCommandxref (calling-reactor
                   endCommandxrefInfo
                   /
                   thecommandendxref
                  )
  (setq thecommandendxref (nth 0 endCommandxrefInfo))
  (cond   
    ((= thecommandendxref "XREF") (setvar "CLAYER" OldLayer))
  )
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun cancelCommandxref (calling-reactor
                      cancelCommandxrefInfo
                      /
                      thecommandcancelxref
                     )               
  (setq thecommandcancelxref (nth 0 cancelCommandxrefInfo))
  (cond   
    ((= thecommandcancelxref "XREF") (setvar "CLAYER" OldLayer))
  ) 
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(VLR_COMMANDXREF-IT)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(princ)


Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: What would you want in a set of Xref tools?
« Reply #32 on: April 02, 2011, 03:54:45 PM »
A tool that sets the layer before attaching and xref.
Do it with a reactor, this is just for the xref command:
Actually I use a reactor now.  Some code that someone here posted; probably that very one that you posted.  ( I am home so I can't check the code to see where I got it.)

I was just thinking that if Tim (and company) is going to create a tool(s) to manage xrefs, might as well include the number a fix for the number one violation cad standards when dealing with xrefs.  IMO.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Rabbit

  • Guest
Re: What would you want in a set of Xref tools?
« Reply #33 on: April 04, 2011, 03:16:11 PM »
I'll think about these.  I want something that is generic, but can be used my a lot of people.  Once you start getting too specific, then it looses functionality in that sense.

Just thinking out loud right now, but I guess it something like this was to happen ( barc, krush ), then a file would need to be setup, so the command would know what to do.  Not saying I'm going to do it, but just thinking how it would be done.

@Rabbit:

I have a lisp like that also, and use it all the time still.  Might be a good thing to copy over to the suite.  Didn't even think about that code.

I dunno where it was that I got this from.  I know it was from somewhere else, and I did a little bit of modification of it so that I can see the layers names & colors and a global variable for the new color.  I hope I didn't stepping on anyone's toes.

Anyways, I use it after I turn all xref layer colors to color 8 (our standard backgoround color).  Using the command I can quickly change the xref layer colors of stuff like rated walls, room names, etc. so they will be more legible.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: What would you want in a set of Xref tools?
« Reply #34 on: April 11, 2011, 11:03:10 AM »
Attached version 0.1 of tools.  Look at the first post for more information.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Rabbit

  • Guest
Re: What would you want in a set of Xref tools?
« Reply #35 on: April 12, 2011, 09:01:26 AM »
Edit: Attached version 0.1 of Xref Suite tools ( source and compiled dll file ).  Once the dll is loaded, it will list what commands can be used, and a brief description of what they are for. 

Okay, I'm apparently the not so bright one here, but how do you load this?

Rabbit

T.Willey

  • Needs a day job
  • Posts: 5251
Re: What would you want in a set of Xref tools?
« Reply #36 on: April 12, 2011, 10:03:42 AM »
Edit: Attached version 0.1 of Xref Suite tools ( source and compiled dll file ).  Once the dll is loaded, it will list what commands can be used, and a brief description of what they are for. 

Okay, I'm apparently the not so bright one here, but how do you load this?

Rabbit

You can either compile a dll from the source code, and then load that in each Acad session.  Or you can just load the dll file that is in the zip file.  To load a dll file, at the command line type ' netload ', and then select the dll file.  One thing to note is that you should load the dll file from a local drive, as there are security issues with network locations and dll files.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Rabbit

  • Guest
Re: What would you want in a set of Xref tools?
« Reply #37 on: April 12, 2011, 10:59:36 AM »

Edit: Attached version 0.1 of Xref Suite tools ( source and compiled dll file ).  Once the dll is loaded, it will list what commands can be used, and a brief description of what they are for.  Comments welcomed.  I'm still working on some of the other ideas that are not in this release.


From my testing:

XOPEN - If possible, when the newly opened xref is closed, it is automatically reloaded in the host drawing.

XRLC - A regen after changes would be helpful.

CN - Works as advertised.

EDITLEYERFROMSELECTION - Works as advertised.  Shorter name would be nice though.

Hope this helps,
Rabbit

PS, I'm not sure which one to use to set the layer override color "XREF|LAYERNAME" in the host drawing.  I.E., if I bring in an xref and I want to change the one of the layers to color 8 in my host drawing only, which utility do I use?

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: What would you want in a set of Xref tools?
« Reply #38 on: April 12, 2011, 11:10:21 AM »
Actually I prefer longer command names.  Disambiguates from any in-house or other third-party commands or personalized PGP settings.  Its easy enough to create a command tool in the CUI for Ribbon/tool palette/tool bars, and it can always be assigned a shorter personalized nmemonic in a PGP.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

T.Willey

  • Needs a day job
  • Posts: 5251
Re: What would you want in a set of Xref tools?
« Reply #39 on: April 12, 2011, 11:47:36 AM »
Thanks for testing, and commenting back Rabbit.  I'll see what I can incorporate into the next release.

PS, I'm not sure which one to use to set the layer override color "XREF|LAYERNAME" in the host drawing.  I.E., if I bring in an xref and I want to change the one of the layers to color 8 in my host drawing only, which utility do I use?

You would use ' EDITLEYERFROMSELECTION ' since it will let you change the properties of one of the layers that one of the entities are on.  Hope that makes sense.

________________________________________________________________________________________________________________

I wonder if I should make another thread to let people know that there is a tool available now for testing?
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

StykFacE

  • Guest
Re: What would you want in a set of Xref tools?
« Reply #40 on: April 12, 2011, 01:18:26 PM »
Probably wouldn't be a bad idea for beta testing and possible bug tracking from user comments from peons like myself. ;)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: What would you want in a set of Xref tools?
« Reply #41 on: April 12, 2011, 03:04:00 PM »
I guess I do another topic for the next release of the testing code.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

kentium3k

  • Newt
  • Posts: 54
  • Adopt a Greyhound! No, not a bus.
Re: What would you want in a set of Xref tools?
« Reply #42 on: April 15, 2011, 06:50:58 PM »
Have MIRRTEXT work with Xref files, many people would like that one a whole lot.
Prosperity is only an instrument to be used, not a deity to be worshiped. C. Coolidge

Crank

  • Water Moccasin
  • Posts: 1503
Re: What would you want in a set of Xref tools?
« Reply #43 on: April 16, 2011, 02:54:38 AM »
And please explain, in short, how you would expect them to work.  Thinking of maybe putting something together, and just want to see what others would like to see happen.

Thanks.

[...]

@Crank - Still not sure how one would want to have the procedure for setting up relative paths work.  I don't use them, so I had to look in the help, and it seems like they can be setup plenty of ways.  Would someone just select the drawing(s) to edit the xref paths, and then have the paths based off that drawings path?  Let me know what your thinking.
My situation:
I just want to get rid of the path because our drawing manager automaticly creates unique folders when the drawing is checked out. Copies of the Xref's are placed in the same folder. With hard coded paths the drawing points to a different location and the XREF can't be found or it's pointing to an old version. :-(
In general:
When you have to sent your drawing, the receiver doesn't have the same drive structure, so I can imagine it would be usefull to strip the part of the structure that's specific for your own company. (example: K:\drawings\project\partnumber\xref.dwg)
« Last Edit: April 16, 2011, 03:00:41 AM by Crank »
Vault Professional 2023     +     AEC Collection

barc

  • Guest
Re: What would you want in a set of Xref tools?
« Reply #44 on: April 16, 2011, 12:11:22 PM »
When you have to sent your drawing, the receiver doesn't have the same drive structure, so I can imagine it would be usefull to strip the part of the structure that's specific for your own company. (example: K:\drawings\project\partnumber\xref.dwg)
eTransmit