Jump to content

Recommended Posts

Posted

Hi Folks,

 

Can someone run my script and tell me why it wont work???  Not new to Civil 3D but fairly new to writing script.  I attached both the script and image of error and version of Script Writer I am using.  I apologize in advance for this maybe being super dumb... but I don't know how to do it...

INSERT-XREF-LAYER.scr

Posted

Share the command history to show what the error is. We can't run it without your drawing and same network path. Also if we are on different systems/versions we may get different results.

Posted (edited)

problem with scripts is they can't handle problems (and that's a big problem). In a lisp routine you can check if a layer is already present : if layer is present , do nothing (my speciality) , if not create it. Same for xrefs , if xref is loaded you can unload / detach it.

 

Like dan20047 said , without same network paths etc it hard to say if your xrefs are in the folder you expect they are or if the xref you try to detach is actually loaded in the first place. Script files are like autistic lisp routines : they can't handle exceptions. Maybe a better option would be to create lisp file for this and load it in a script like < (load "FixMyX.lsp") + FixMyX + qsave >

 

One thing you could do , just for testing , fill in the full path instead of ..\\..\\ , just to see if that part is working. You can allways change that later. I believe master Lee has a change relative path routine on his site.

 

🐉

Edited by rlx
Posted (edited)

My windows has now decided that .scr files should not be opened. I dont really want to start setting up scr is ok but I may have to. Just read about whitelist and scr for another post similar problem and may even be just that the script is being blocked.

 

As I did not open script just a stab is server name \\\\servername\\  note the 4 \\\\ if a drive K:\\myprojects\\

Edited by BIGAL
Posted

Hope my company isn't gonna block scr files but if they do I'm ready for them as I've shown in similar post your talking about Bigal 🙂

 

As for xref path's , I have dumped relative paths all together because this doesn't always (never?) work on mapped network drives.

 

So I use "//my-company-name.com/my-server-path/whatever/xref/bite-me.dwg". And I have a lisp routine called fip (fix xref path) that can fix paths when needed. So when I have to work on drawing with xref they are copied to project server , I change xref path to match project folder and when I'm done , I use fip.lsp to restore all xref paths. Also made a odbx version to do the entire network. But all routines are so company specific they are pretty much useless for somebody else.

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...