Jump to content

xref


au-s

Recommended Posts

Hello,

 

New to this ...

I made a lisp inserting xref...

 

is that a possibility with lisp to attach xref (overlay) by choosing it from a directory?

Is it also important for me that the current file that is open changes to UCS:world and then after insertion going back to previus UCS. Of course the insertion point needs to be 0,0 I presume.

Tahts to make sure that the xref attaches in the same place as the current drawing.

 

Any lisps outhere that I can take a look at=?

 

Thanks

 

best regards

 

/Artur

Link to comment
Share on other sites

Hello,

 

]((defun c:xr2 () 

(setq dfil (getfiled "Välj Xref:" "" "" 2))

(command ".layer" "m" "XREF" "c" "7" "" "")

(command "open" dfil)

(command "ucs" "w")

(command ".xref" "o" dfil "0,0" "1" "1" "0" "")

(command "ucs" "p")

(princ)

)

 

 

What I want here is to choose an xref and then the lisp puts an existing drawing to ucs=world then efter insert to ucs=previous

 

is that okej? it works for me... maybe can be done differently

 

Can I specify so the chosen path is remembered next time?

 

Thanx

Link to comment
Share on other sites

type in autocad -xref as a command and write down all the values u had to add to get it done and then basically fill that out into a lisp file. That should be all you need to do. Here is a command line for a lisp that will allow you to set a key shortcut for it.

 

(defun c:IX     ()   (prompt "Insert Xref ...")        (command ".-xref")       (princ))

add the rest of the code in after that line.

 

Basically any command that runs through a dialog box on your screen can run through the command line. To run it through there all you need to do is a an - in front of the command and it will allow you to entre in info in the command line. Since you can do that you can use that to information you added to fill in lines into your lisp and make it work for the xref you want to add.

 

Hope that helps :D

Link to comment
Share on other sites

okej .. I dont think I understand ..

Here is what I have so far...

 

I think its something to do with the getfiled because I always, ALWAYS go to My Documents .. and besides that box which opens is not resizable. When I open xref to attach via autocad the window for opening files looks different and it remembers the previous path.

 

(defun c:xr2 (/ dfil)
(setq dfil (getfiled "Välj Xref:" "" "" 2))
(command ".layer" "m" "XREF" "c" "7" "" "")
(command "open" dfil)
(command "ucs" "w")
 (command ".xref" "o" dfil "0,0" "1" "1" "0" "")
 (command "ucs" "p")
(command ".layer" "LO" "XREF" "" "")
(princ)
)

Link to comment
Share on other sites

No,

 

I use XP...

 

I cant make the file path .. users have to choose their own XRWEF-file ...

According to that thread I have to hard-code to the exact path... I dont want that...

I want users to pick one xref they desire :)

 

thanx

 

/Artur

Link to comment
Share on other sites

It wont work unless the file you are xrefing is in a file path that you have set up in your options.

 

Add the directory where the file is stored into your "support file search path" under files in options. Otherwise you need to use coding like this

(SETQ $PATH "D:/Personal/CAD/Support/");CHANGE THIS TO THE PATH THAT YOU PASTE YOUR xrefs TO. CHEERS

 

Then in your coding where it loads the xref put this in (strcat $PATH "FILE NAME IN HERE DONT USE EXTENSIONS")

 

Try that out

Link to comment
Share on other sites

I dont know what you mean?

 

I dont want to specify a path for me ... or for any user at the office.

I want them to open and choose xref like with xref-manager.

Next time they use this lisp the lisp remembers on wich path the specific user in the office was last time.

 

Like with xref mananger or open file thing :)

If you open a file and browse to a specific path .. then you open one more then the path is "remembered".

 

Is getfiled wrong maybe???

Link to comment
Share on other sites

I dunno if what has been done here is of any benefit to you or not.

 

But, have been in the civil engineering biz for a good thirty + years. Due to the scale factor problems associated with Autocad, we early on adapted the work to fit the paln, to fit the output of the plotter, etc.

 

But basically, we make up several files all situated to fix only one job. Steal a lot of information off of others to set-up, but within one day or so it becomes an individual. We draw on to 24 by 36 inch sheets so our whole world revoles around that size.

 

Not long ago, worked on a plan for a Rite-Aide drug store. It was on a corner, where streets came in 120 degrees apart from one another. These sort of projects sort of require numerous but same looking sheets. For our project we considered the two street centerline intersections of Howard and Campus to be 0,0 when illustrated on each plan sheet, but in actuality, they carried Calif. coordinates in to the millions. Each old and new plan had the BASE set at the intersection. Now at just looking at the site, Campus was sitting at about 30 degrees to right. Howard was nearly 90 degrees straight north.

 

Two individual plans were set up one being Howard and the other being Campus. All of the topo and field survey information was brought into one plan called OVERALL. And all design work was done to this plan. Each individual plan for information regarding sewer, grading, or concrete was similarly XRED'd into this one OVERALL sheet. All layers were active and turned on.

 

Then, open up the plan Campus, and XREF in OVERALL, and mainly rotate such that he centerline is exactly West to east. Did same with other dummy plan called Howard, and rotated that information to align with the shown centerline of Howard still holding the BASE to where easily found. Need a whole new drawing created (like for shrubs and irrigation from some consultant), add it to OVERALL and it will be aligned OK in the end jsut before plotting.

 

Then created a new plan (actually many of them) in Paper space, with a window below and the XREF'd in either Howard or Campus. Set to scale ratio of 1/40. Nothing else done except to shift the BASE point around to align with the grid or make for fewer sheets. Then when Model Space is opened up, I can easily measure from here to here is So Many feet. Don't often open up in Paperspace, as from here to here is usually only in inches. If you are working on certain sheet of sewer, turn off all layers that do not apply and plot out. Next sheet similar but slightly different. The XREF biz will permit a daisy chain effect, and bring in more drawings than needed. Until all 36 sheets are completed for the lone Rite-Aide store.

 

Object here is that you can XREF in one named drawing and it will then bring in others too. If that one has been rotated (like Campus), it will also come in to your new file as a being a rotated drawing already then.

Link to comment
Share on other sites

That is correct. But if you xref in an xref that has other xrefs in it you must make sure that the xref's are set to attach not overlay otherwise when you try and bring in this xref it will only show whats drawn in that file, not all that is in it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...