Lucas11 Posted October 18, 2024 Posted October 18, 2024 (edited) Background: I have a dwg with multiple sheets (each layout tab is another sheet). In in a wiring diagram, some wires go off page, and so I have to show the page number the wire is jumping to. Let's say I have a Rectangle A and a Rectangle B and a wire (line) that I want to show is connecting the two rectangles. However, Rectangle A is on sheet 1 (Layout tab 1) and Rectangle B is on sheet 2 (Layout tab 2). And so I would draw a line from Rectangle 1 but then at the end of the line, I put the sheet number (layout tab number) that Rectangle B is located on. I would do the same for Rectangle B and at the end of its line show the sheet number (layout tab number) that Rectangle A is located on. Problem: I would like to move Rectangle B to another sheet, say sheet 3 (Layout tab 3), and the reference to Rectangle B that's on sheet 1 would automatically update from sheet 2 to sheet 3, or whatever sheet number I move Rectangle B to. Is it possible to have the sheet number reference automatically update to the sheet number where the referenced Rectangle is located? EXAMPLE.dwg Edited October 18, 2024 by Lucas11 Attaching dwg Quote
BIGAL Posted October 20, 2024 Posted October 20, 2024 Just a comment I have looked at this a few times thinking about how to do. In a grid style of sheets can have up to 4 sheets touching. One possible way is using fields that you would get a A B C etc from a sheet and put that into the description of connection. So would have "A" Rather than "Sheet 1". So manually can be done. Or have "A" on a non plot layer. Try this a very simple make a field from one text and put answer in another. ; make a field from one text and put answer in another. ; By Alan H Oct 2024 (defun c:wow ( / obj1 obj2 str txt) (setq obj1 (vlax-ename->vla-object (car (entsel "\nPick source text ")))) (setq obj2 (vlax-ename->vla-object (car (entsel "\nPick destination text ")))) (setq id (vlax-invoke-method (vla-get-Utility (vla-get-activedocument (vlax-get-acad-object))) 'GetObjectIdString obj1 :vlax-false)) (setq str (strcat "%<\\AcObjProp Object(%<\\_ObjId " id ">%).TextString>%")) (vlax-put obj2 'textstring str) (princ) ) Quote
Lucas11 Posted October 21, 2024 Author Posted October 21, 2024 I am new to LSP, but I think this would do the trick... So I currently name my layout tabs as numbers so that they act as page numbers. Apparently, there is an LSP function that can get the string of any property of an object. Well if I select an object, and then type "LIST", it outputs all the properties of that object. One of the properties listed is "Layout" and is the name of the Layout tab it's on, which in my case would act for me like the page number. Is there a function that can grab the string of the "Layout" property? And then, ss it possible to have a script that when I select an object, I can make the destination text change to the name of the selected object's current layout tab (which I'm using as a page number? I'm not sure if this helps, but it looks like the autocad variable "ctab" is the name of the current layout. Quote
CyberAngel Posted October 21, 2024 Posted October 21, 2024 If you use sheet sets, you can assign a sheet number (or a custom property) to a field. Whenever the sheet number changes, all the fields that reference it will change as well. Will that do what you want? Or are sheet sets not an option? Quote
Lucas11 Posted October 21, 2024 Author Posted October 21, 2024 Sheet set are unfortunately not an option 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.