spur Posted May 3, 2010 Posted May 3, 2010 Hi, I'm trying to link an external document (Word/Excel) to drawing through Hyperlink so when I click the hyperlink within the external document the drawing will open to a zoomed in location/view of the drawing. I have named a view within a drawing and added this to a Hyperlink. When I select the objects and ctrl click it will zoom into the desired view. When I select the Hyperlink from the external document the drawing will open but not the desired zoomed in view required. Any ideas/advice on how I can achieve this will be greatly appreciated. Quote
MikeScott Posted May 3, 2010 Posted May 3, 2010 Whatever view you have open when you save the drawing will be the starting view when you open the file. In theory, you COULD have a list of hyperlinks visible in that view.. that way someone opens the drawing and uses the hyperlink, which enables them to see the detail. ---- Or.. more to what you're asking about, my AutoCAD help screen says this: drive:pathname\acad.exe" ["drawing name"] [/switch "name"] When using a switch option, you must follow the switch with a space and then the name of a file, path, or view within quotation marks. For example the following entry starts AutoCAD from a folder named AutoCAD 2002 with the template drawing arch1.dwt, and restores a named view PLAN1. "d:\AutoCAD 2002\acad.exe"/t "d:\AutoCAD 2002\template\arch1" /v "plan1" **Update** (I think the "/t" is just to indicate it's a template, I don't think you'll need that, but pay attention to the quotation marks.) So, in theory, you could use this as an external hyperlink, but it may not work with the spaces required. If that's the case, you could put that line into a batch file (text file, but change the extension to ".bat") and hyperlink to that batchfile. Instead of a batchfile, you could also put the information into the "properties" portion of a shortcut, and link to that. Quote
spur Posted May 3, 2010 Author Posted May 3, 2010 Thanks Mike for your reply. I will research this option. Would this route be able to handle lots of diffrent views within one drawing or would it only work on one view? The result I would like to achieve is to link an external document to open the drawing and zoom to show the "view" i.e. room/s within a floor plan. Reading the help file on Hyperlink it seems to suggest that it should be possible to Hyperlink to a view. I have tried to look a the target option in the Hyperlink dialog box but as yet have not been able to get the desired result. At the moment the only result i have is to click the Hyperlink in the external document and it opens the drawing but not to the zoomed in view that is named. Does this Hyperlink in the external document need to include the named path as described in your post regarding switch to enable the named view? Thanks again. Quote
spur Posted May 5, 2010 Author Posted May 5, 2010 Hi Mike + others who maybe able to help. I have tried the above switch and can not get AutoCAD to launch the drawing named in the switch with the view included. Anyone have any ideas where I need to look as to why this switch is not working? I have read the AutoCAD help section for hyperlinks and if I have understood correctly the hyperlink with a name view should open the drawing to this view, can someone clarify if this is correct and explain why I cannot get this process to work? The external document with a hyperlink set will only open the drawing and not to the required named view. Do I need to adjust the link somehow for the Hyperlink in the external document? Thanks. Quote
MikeScott Posted May 5, 2010 Posted May 5, 2010 This is because the Hyperlinks don't do switches or spaces very well, and so it's translating them. I got it to work a slightly different way.. Try this instead: Start a text file and type the link with spaces, quotations, and switch(es), capitalization is important. Type it all on one line: "path location and name of autocad program" "path location and name of drawing file" /v "Name of Named View" Next, hit enter to start the next line. (it's important that there is one line of text, followed by one enter) Then save the file as "test.bat" When you click on that file, it will load autocad and file, showing the named view. I just did it myself and it worked just fine. Don't forget the quotes, the spaces, and the paths to the files. If you don't know the path to your autoCAD, do a search for "acad" and look at the list for the acad.exe file... once you've found it, you can figure-out the path, either by reading the pathname given right there, or by checking properties on the file. *Update* If that's not working, post what link you're putting in that BAT file, and I'll help you troubleshoot.. remember.. capitalization is important. Quote
spur Posted May 7, 2010 Author Posted May 7, 2010 Hi Mike, Sorry for the lateness of the reply been busy working on some other things. Will give this a shot over the weekend and post my results. Thanks. Quote
spur Posted May 7, 2010 Author Posted May 7, 2010 Hi Mike, This is the link I’m typing into a word document. I then go to save and in the save as file name type “test.bat” As yet I have not been able to get the drawing to launch when AutoCAD is open. I have also tried the same link below without / between the program and file drawing and /v between program and file drawing. "C:\Program Files\AutoCAD 2009\acad.exe"/ “C:\Documents and Settings\Drawing2” /v “Cross” Thanks for your help it is very much appreciated. Quote
MikeScott Posted May 8, 2010 Posted May 8, 2010 You had it right (except for one "\"), assuming those paths are accurate and the capitalization is right. You just need to do it in Notepad so that it's ASCII text. I did it for you here.. the txt file, and then I zipped-up the bat file. The only difference is that I changed the filename to BAT (and zipped it up).. I did that just in-case you are set-up to hide known file extensions... You have to be able to see the extensions in-order to change them correctly. I put in exactly what you gave me, and erased all characters in the file after the last visible character, hit enter once, and then saved it. (*update* and then removed the "\" from the original and re-did it all and reposted it here.. doh) You can rename the TXT to BAT, or open the zipped file and use the one I renamed already. Let me know how it goes.. Drawing2-Cross.txt Drawing2-Cross.zip Quote
spur Posted May 8, 2010 Author Posted May 8, 2010 Hi Mike, Thanks for this. I can get AutoCAD to open with your file after saving the notepad file to "test.bat". The problem I now encouter is that AutoCAD is saying it can not find the file please verify it exists. I can open this file no problem by going to open and browsing to the file. If i save changes the attached dialog box is shown. Am I correct that this is the right file path that i have put in the link? Thanks.File Path Drawing2.doc Quote
MikeScott Posted May 8, 2010 Posted May 8, 2010 Only three things I can see that might be causing an issue: #1- Try putting the .dwg at the end of the filename in the txt I sent you. It worked on mine without doing that, but I'm running a different version of CAD. #2- Verify that acad.exe is indeed on the path you entered, and capitalized the way you entered it. Some installations may vary. That location is actually the directory it'll be trying to work in.. On some installations, your computer will run ACAD.EXE no matter what path you tell it.. so if that location is invalid, and the folder doesn't exist, it'll fail on you. On my system, I had to set my path to the actual location or it wouldn't run. #3- CAD used to have a lot of issues with "spaces" in filenames.. I'd be a LITTLE surprised if that were the issue, but if you move the file (or save a copy of it) to another path that doesn't have spaces in the name, it might correct the issue. Warning though.. you have to save as an ACII file. Notepad is the easiest way to do that, Word will do it, but you have to tell it to.. it doesn't do it by default. *UPDATE* Maybe this is handled differently in AutoCAD 2008.. check your help files to see if the format has changed. If nothing else works, or your usage requires a path with spaces in it, try using two sets of quotes around the drawing path.. Using it as a hyperlink, and THEN passing it to your version of AutoCAD might strip/off one set of quotes. OR, conversely.. you might need to remove that second set. I'd be surprised if that fixed it for you, but I see little else that can be done here. To answer one of your earlier questions, a separate batchfile would be needed for each hyperlink, unless you wanted to hit one link and have the multiple files open at the same time. If you answer me soon, I'll get right back to you, but if you wait too long, I'll be out doing weekend chore stuff.. I've got a 3 week vacation to the UK, starting this week and have stuff to take care of. Quote
spur Posted May 9, 2010 Author Posted May 9, 2010 Hi Mike, I have tried some of these suggestions, I ran a search on the acad.exe and the file path in the folder section of the search is stating C:\Program Files\AutoCAD 2009 I have tried changing the Notepad link with ACAD.EXE and still have the same problem not finding the file. I also moved the Drawing2 file to a different location (desktop), changed the Notepad to this new location and still no luck. I have changed the Windows Explorer options and uncheck the "Hide file extensions for known file types" option and still no luck. I have tried to find clarification on the Web if ANSI is the same as ACII as I don not get that option in the file save as dialog box encoding section. I only see ANSI, Unicode, Unicode big endian, UTF-8 as I see you say to save as a ACII file. Thanks for you time on this and advice on this. *Update* Juste realised my AutoCAD type was listed as 2008, now changed to 2009. Also with regards to the question on ACII would i need a thrid party application to enable a save as ACII?? Hopefully you may pick this up before your visit to the UK (The weather is not the best at the moment 12 – 13 degrees today, overcast) and if you pick this after your vacation hope you had a great visit!!!!!!!!!!!!! Quote
MikeScott Posted May 9, 2010 Posted May 9, 2010 The new location you chose still had spaces in the name, try making a directory and putting it in "C:\test\" instead Sorry.. ANSI is fine.. I thought it was ASCII, but it's ANSI, I had to go back and look at it. I beleive WORD will save it in that format, but if not.. as I said, Notepad will do it. (right-click within a folder, or on your desktop, choose "new" and "text document") Thanks for your well wishes.. Just keep that volcano under control and tell British Airways to quit with the strike thing.. I'm supposed to leave there on Monday the 31st.. but they're starting that Monday thru Friday strike thing the week after next. I can't afford to get stuck over there, so I might have to leave early and everything's already paid for! Quote
spur Posted May 13, 2010 Author Posted May 13, 2010 Hi Mike, Tried moving to its own directory by moving the drawing to its own folder Test. “C:\Test\Drawing2” /v “Cross” This resulted in AutoCAD opening to the default Drawing1. After this I tried the command without spaces and found it went back to the dialog box asking to verify the file exists. I also tried to put a switch in the shortcut as described in AutoCAD help to see if I could get that to work. The following command was entered into the Target box on the shortcut properties dialog window. "C:\Program Files\AutoCAD 2009\acad.exe" “C:\Test\Drawing2” /v “Cross” /b "startup" This open AutoCAD again and a dialog box appeared saying “startup.scr” Can’t find file. I will keep trying to resolve but if anyone out there could give any tips to try please forward. Thanks. Quote
MikeScott Posted May 13, 2010 Posted May 13, 2010 putting "startup" where you did, told it to load the scriptfile, and it definately recognized it.. so SOMETHING's right. verify that the named view is capitalized the way you think it is, and not like.. all caps or something within AutoCAD. Interesting though.. in your post, you used three different styles of quotation marks on that single line. You can't do that in the BAT file. Please tell me you're using Notepad instead of Word.. that format is gonna' kill the BAT from working correctly if it's subbing in different CHR$ control codes to do the fancy quotation marks. Quote
spur Posted May 13, 2010 Author Posted May 13, 2010 Hi Mike, Yes using Notepad. Thank you so much you have solved my problem at least for this stage! Just changed all the quotations to read the same and bingo AutoCAD opened Drawing2 to the named view using your .bat file description. Just opened a word document and inserted a Hyperlink to this “test.bat” file. Clicked on the Hyperlink and AutoCAD opened to Drawing2 to the named view. Result!!!!!!!! Just to confirm one of your earlier responses in this thread each view required would need a separate named view in the drawing and a separate .bat file to this view. Then Hyperlink each of these .bat files in an external document to open the drawing to the named view. Thanks so much for sticking with me on this and getting me to this stage. Quote
spur Posted May 13, 2010 Author Posted May 13, 2010 Hi Mike, Just tried this. Put a second link into a Notepad file under the Drawing2 / Cross link, Drawing2 / Cross 2 and created a .bat file. The result was AutoCAD opened to the first view Cross. On closing AutoCAD it opened straight away this time to Cross 2 view. Think I may have answered my own question above on separate .bat files and then Hyperlink to the external document. Once open to the desired view in the drawing if I then need to move to a different area (Room/Location) I can use the view command and select the desired named view. Thanks again think this will come in useful for linking external schedules such as asset registers to rooms etc. Quote
MikeScott Posted May 14, 2010 Posted May 14, 2010 glad I could help.. last minute too, my flight is today. By the way, I beleive you can set it up so that the view you open has an internal hyperlink to the next view. Just look-up hyperlink in your help file and it'll explain how to do it. I've never done it, but give it a shot and I'll help you troubleshoot as soon as I get back Quote
spur Posted May 14, 2010 Author Posted May 14, 2010 Hi Mike, Thanks for the tip on internal hyperlink method, will try over the next couple of weeks. Have a great visit, hope you enjoy the UK if it is your first time here. Quote
MikeScott Posted May 14, 2010 Posted May 14, 2010 thanks.. It's not my first, but I'll try to enjoy it anyway. Quote
Recommended Posts
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.