Jump to content

Search the Community

Showing results for tags 'xref'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. HI there, Am working on an AutoCAD LT drawing with several XREFs. I have been hatching some small areas and, last click of the day (isn't is always) one of the hatched areas appeared to leave the defined boundary and created a new hatch ALL OVER the main drawing, referncing multiple areas on the top survye XREF below - not just one area, but hundreds of them - all the way down the length of the Road. Every time i click on these hatches the whole drawing freezes and crashes. When the freeze stops after a few minutes, you can see that it has selected the entire xref layer - all of the lines and grips from the xref have been selected. Even though it's detached. And i mean ALL the lines and grips - not just those that seemt o be associate with the weird hatching. I have detached the xref, hoping that they would disappear, but they remain on the main drawing (all of the x ref lines disappear, but the hatches remain visisble. What's also strange is that the main drawing still displays the 'xref' layer i had used - but whe i go to 'laydel' list to try and remove it all completely fromt he drawing, that layer is missing from the list. If i reattch the survey - it appears in the 'laydel' list again. Have uploaded four images here - one with the xref attached, one with it detached (you can see all the grey hatch shaps more easily, scattered along the road length) and one image showing the layer XREF1 which held the xref, and then the laydel options where that layer is just missing - at the same time it is in use on the drawing. Then the last image shows all the lines and grips selected after the few minutes wait, when i have clicked on the hatched area and it has frozen - even though that XREF is detached (so not there, right?). How is the main drawing still referencing those xref lines even though it's not there? And on a layer i can't delete? How do i fix!? Hope this all makes sense...
  2. Hello Everyone, I am trying to align simple objects (line circles, etc) and blocks to lines that exist in a xref'd file. An example is if I have a general arrangement floor plan (that has been produced and owned by others in my team). I would like to create a set of dynamic drawings that would change with changes to the general arrangement drawing. I understand that the original author can add, delete and redraw lines that I have aligned to, however I will address these as they occur.
  3. We regularly export Civil3D files to CAD so we can use them in either CAD and Revit. We have run into a few problems with this workflow, since any xrefs that aren't detached before exporting become blocks in the CAD file. Additionally, Revit automatically enables all the layers when you insert the CAD file, so you have to manually disable them again. I have created a simple lisp that detaches the xrefs and deletes the listed layers using code I pulled from various forums. However, I've got two issues: 1. The dellayers function claims to delete the DR_X_Text layer, but the layer and the entities on that layer remain in my drawing after running the command. 2. I'd like to princ the list of removed xrefs as well, but I'm not sure where to place that code. (defun c:Civil3DtoCAD (/) (c:detachxrefs) (c:dellayers) (princ) ) (defun c:dellayers (/ e) (foreach layer '("DR_X_Text" "_11-2606G1K-1-24" "_11-2607G1K-1-24" "_11-2608G1K-1-24") (if (setq e (tblobjname "layer" layer)) (progn (vl-catch-all-apply 'vla-delete (list (vlax-ename->vla-object e))) (princ "Layer ") (princ layer) (princ " deleted.\n") ) (progn (princ "Layer ") (princ layer) (princ " not found.\n") ) ) ) (princ) ) (defun C:Detachall (/ *error* mip:layer-status-restore mip:layer-status-save delete-xref-img-underlay delete-all-dict ) (vl-load-com) (defun *error* (msg) (mip:layer-status-restore) (princ msg) (princ) ) ;_ end of defun (defun mip:layer-status-restore () (foreach item *PD_LAYER_LST* (if (not (vlax-erased-p (car item))) (vl-catch-all-apply '(lambda () (vla-put-lock (car item) (cdr (assoc "lock" (cdr item)))) (vla-put-freeze (car item) (cdr (assoc "freeze" (cdr item))) ) ;_ end of vla-put-freeze ) ;_ end of lambda ) ;_ end of vl-catch-all-apply ) ;_ end of if ) ;_ end of foreach (setq *PD_LAYER_LST* nil) ) ;_ end of defun (defun mip:layer-status-save () (setq *PD_LAYER_LST* nil) (vlax-for item (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)) ) ;_ end of vla-get-layers (setq *PD_LAYER_LST* (cons (list item (cons "freeze" (vla-get-freeze item)) (cons "lock" (vla-get-lock item)) ) ;_ end of cons *PD_LAYER_LST* ) ;_ end of cons ) ;_ end of setq (vla-put-lock item :vlax-false) (if (= (vla-get-freeze item) :vlax-true) (vl-catch-all-apply '(lambda () (vla-put-freeze item :vlax-false)) ) ;_ end of vl-catch-all-apply ) ;_ end of if ) ;_ end of vlax-for ) ;_ end of defun (defun delete-xref-img-underlay (/ count txt) (mip:layer-status-save) (vlax-for Blk (vla-get-Blocks (vla-get-activedocument (vlax-get-acad-object)) ) ;_ end of vla-get-Blocks (if (and (= (vla-get-IsXref Blk) :vlax-false) (not (wcmatch (vla-get-name Blk) "*|*")) ) ;_ end of and (progn (setq count 0 txt (strcat " Erase Xref and Underlay in " (vla-get-name Blk) ) ;_ end of strcat ) ;_ end of setq (grtext -1 txt) (vlax-for Obj Blk (setq count (1+ count)) (if (zerop (rem count 10)) (grtext -1 (strcat txt " : " (itoa count))) ) ;_ end of if (if (and (vlax-write-enabled-p Obj) (or (and ;_ XREF (= (vla-get-ObjectName obj) "AcDbBlockReference") (vlax-property-available-p Obj "Path") ) ;_ end of and (and ;_ UNDERLAY (wcmatch (vla-get-ObjectName obj) "*Reference") (vlax-property-available-p Obj "UnderlayName") ) ;_ end of and (= (vla-get-ObjectName obj) "AcDbRasterImage") ;_ IMAGE ) ;_ end of or ) ;_ end of and (VL-CATCH-ALL-APPLY 'vla-Delete (list Obj)) ) ;_ end of if ) ;_ end of vlax-for ) ;_ end of progn ) ;_ end of if ) ;_ end of vlax-for (mip:layer-status-restore) ) ;_ end of defun (defun delete-all-dict (dict) ;;; dict - dict name (like "ACAD_IMAGE_DICT", "ACAD_PDFDEFINITIONS" ... ) (vl-catch-all-apply '(lambda () (vlax-map-Collection (vla-item (vla-get-dictionaries (vla-get-activedocument (vlax-get-acad-object)) ) ;_ end of vla-get-dictionaries dict ;_ "ACAD_IMAGE_DICT" ) ;_ end of vla-Item 'vla-delete ) ;_ end of vlax-map-Collection ) ;_ end of lambda ) ;_ end of vl-catch-all-apply ) ;_ end of defun (vl-load-com) (delete-xref-img-underlay) (command "_-xref" "_d" "*") (while (> (getvar "CMDACTIVE") 0) (command)) (mapcar 'delete-all-dict (list "ACAD_IMAGE_DICT" "ACAD_PDFDEFINITIONS" "ACAD_DWFDEFINITIONS" "ACAD_DGNDEFINITIONS" ) ;_ end of list ) ;_ end of mapcar (command "_.regenall") (command "_.externalreferences") (princ) ) ;_ end of defun (defun c:detachxrefs ( / block-lst xref-lst nxt-blk n) (PROGN (SETQ block-lst (LIST (TBLNEXT "BLOCK" T))) (SETQ xref-lst NIL) (WHILE (SETQ nxt-blk (TBLNEXT "BLOCK")) (SETQ block-lst (APPEND block-lst (LIST nxt-blk))) ) ;_ end of WHILE (FOREACH n block-lst (IF (AND (ASSOC 70 n) (EQ (BOOLE 1 4 (CDR (ASSOC 70 n))) 4)) (SETQ xref-lst (APPEND xref-lst (LIST (LIST (CDR (ASSOC 2 n)) (CDR (ASSOC 1 n))) ) ;_ end of LIST ) ;_ end of APPEND ) ;_ end of SETQ ) ;_ end of IF ) ;_ end of FOREACH (IF xref-lst (c:detachall) (PROGN (PRINC "\nNo References to Detach... ") (PRINC) ) ) ;_ end of IF (PRINC) ) ;_ end of PROGN ) ;_ end of defun
  4. Using Autocad Arch. 2014 I am new to sheet sets so here is what I want to be able to do. My architectural drawings has a line for Issue Date. I want to be able to change the Issue Date only once and have all of the sheets "Issue Dates" updated. What I am currently having to do is to change the dates manually of each sheet. Waste of time and completely inefficient. Can or should I xref a date field somehow and place it on my template before making a sheet set template. Or is there some other way of easily updating the Issue Date field just once and all of the other sheets will update automatically. Can this be done in a sheet set? Thanks to all
  5. Alan_KD

    XREF layer

    Hello everyone, I have been developing some routines for the pas 6 months, so my knowledge is not very high. Normally I manage to find answers online, thanks to all of you who share their knowledge, it's so helpful. I am writing a routine which would: Compare the XREF name on the drawing and the XREF 'real' file name and match them (on the drawing) if different. After the code checks if the XREF name matches a specific formatting and if it does creates a layer based on it (if the layer does not already exist). The final step is to change the XREF layer to that one, and here is where I am getting an error. I tried with different ways to do this and always got an error. I guess I could try to get this done without using vl code but this is really puzzling me and I would like to know why is actually not working, I dont see where the code could have gone wrong. The example names of my XREFs: which are used to compare with the wcmatch "*_*_*_*" XREF_TGLMTE_PRO_INTER_BASSINS_01 XREF_TGLMTE_PRO_INTER_RESEAUX_HS_2025_01 XREF_TGLMTE_PRO_TRC_V5_IND_D I used different lines of code to try to achieve this, as you can see on my commented lines on the code. I am currently using a (vlax-put-property it2 'layer strcalq) inside a vlax-for getting the following error: (defun c:xrcalque (/ AcadObj AcadAct LyAct it2 xrobjectname strcalq) (vl-load-com) (setq *error* ABD:Error) (setq AcadObj (vlax-get-Acad-Object)) (setq AcadAct (vla-get-ActiveDocument AcadObj)) (setq LyAct (vla-get-layers AcadAct)) ;get layers from Active document (xrn AcadObj AcadAct); runs the subroutine to change XREF name on drawing to match XREF file name (vlax-for it2 (vla-get-blocks AcadAct) (setq ind1 3) (setq ind2 0) (setq ind3 0) (if (= (vla-get-isxref it2) :vlax-true) (progn (setq xrobjectname (vl-filename-base (vla-get-name it2))) (if (wcmatch xrobjectname "*_*_*_*"); (progn (repeat ind1 (setq ind3 (+ ind2 1)) (setq ind2 (vl-string-position (ascii "_") xrobjectname ind3));gets firs position of "_" character ) (print xrobjectname) (setq ind2 (+ ind2 2)) (print ind2) ; ind2 is the position of the ind1 "_" element (3rd) to count from there to have the layer name (setq ind4 (vl-string-position (ascii "_") xrobjectname nil T)); last "_" position (setq ind5 (vl-string-position (ascii "-") xrobjectname nil T)); last "-" position (if (> ind4 ind5)(setq indlst ind4)(setq indlst ind5)) ;check which one is bigger (setq indlst (+ 1 indlst)) (setq strcalq (strcat "SF-XREF_"(substr xrobjectname ind2 (- indlst ind2)))) ;Create layer with string from ind2 position to ind4 or ind5 position (strcalq) (print strcalq) (if (not (tblsearch "LAYER" strcalq));checks non existance of layer (progn (vla-add LyAct strcalq) (print "Layer has been created") ) (progn ;(vla-put-layer it2 "0") ; (print "this is a test4") (print "layer exists") ;if layer exists put object on layer ) );if (print strcalq) ;(vla-put-layer it2 "0") ;(vla-put-layer xrobjectname strcalq) ;(vla-put-layer (vla-get-name it2) strcalq) ;(vlax-put it2 'Layer "0") ;(vlax-put (vlax-ename->vla-object (vla-get-name it2)) 'Layer "0") (vlax-put-property it2 'layer strcalq);############ ERROR############### );progn (print "wcmatch xref name not matching") );if );progn );if ;(vlax-put (vlax-ename->vla-object xrtemp) 'Layer strcalq) );vlax for (print "highly recommended to purge layers") ;add code to purge automatically the layers? (princ) );defun ;;;======================================= Error function ++++++++++++++++++++++++++++++++++++++++;;; (defun ABD:Error (st) (if (not (member st (list "Fonction annulée" "quitter / sortir abandon"))) (vl-bt) );if ;(princ "Merci d'envoyer vos commentaires ou report d'erreurs à ") (princ);clean exit ? );defun error ;;;======================================= function xrn +++++++++++++++++++++++++++++++++++++++++++;;; (defun xrn (AcadObj AcadAct / item xrobjectnamexrn xrfilenamexrn) (vlax-for item (vla-get-blocks AcadAct) (if (= (vla-get-isxref item) :vlax-true) (progn (setq xrobjectnamexrn (vl-filename-base (vla-get-name item))) (setq xrfilenamexrn (vl-filename-base (vla-get-path item))) (if (/= xrobjectnamexrn xrfilenamexrn) (progn (vla-put-name item xrfilenamexrn) (vla-reload item) ) ) ) ) ) );defun xrn If someone could explain why this is not working, and please share a way to achieve my goal would be awesome! Thank you in advance, Alan
  6. Tim S

    WBlock + xref

    Is there a way to create a block that includes xref files? WBlock only includes the DWG and not the xref.
  7. Hi all, I have a script taken from here which I've tweaked to get the count. (defun C:XREFCNT (/ i x) (setq i 0) (vlax-for x (vla-get-blocks (vla-get-ActiveDocument (vlax-get-acad-object)) ) (if (eq (vla-get-IsXref x) :vlax-true) (setq i (1+ i)) ) ) i ) XREFCNT returns the number in the commandline. How do I then do an alert, the code below doesn't work. It errors with: error: bad argument type: fixnump: # (if XREFCNT > 0) (alert (strcat "Number of External Reference Drawings = " (itoa (strcat XREFCNT))) )
  8. Greetings, Im working on a test lisp to see if I can automate binding an existing xref & converting a bounded block reference back into an xref. while I was able to automate bind, I realized the express tool (-blocktoxref) is incompatible with lisp as it cant seem to find the command. Then I created a script that allows me to set up an open command, but I cant seem to use my local variables (BLKNAME & NEWFILEPATH) with the script command. So my question is, Is it possible to write a script via lisp? and if so how? (defun c:ws_Layer_copy () (vl-load-com) (setq en (ssget "x" '((0 . "insert") (8 . "XREF - ELECTRICAL - 1")))) (setq ent (ssname en 0)) (setq EN (entget ent)) (setq layno (vl-string-left-trim "XREF - ELECTRICAL - " (cdr(assoc 8 EN)))) (setq dwgpath (getvar "dwgprefix")) (setq dwgname (getvar "dwgname")) (setq nametrim (vl-string-right-trim "HVAC LAYOUT.dwg" dwgname)) (if (= layno "1") (setq layname "1st") ) (if (= layno "2") (setq layname "2nd") ) (if (= layno "3") (setq layname "3rd") ) (if (= layno "4") (setq layname "4th") ) (if (= layno "5") (setq layname "5th") ) (setq newfilepath (strcat nametrim layname " Floor Electrical" )) (setq blkname (vl-string-left-trim dwgpath newfilepath)) (command "-xref" "bind" newfilepath ) ;---------------------------------------------------------------------- (command "script" "blocktoxref.scr" ) )
  9. Hi all, When using certain commands, my command line repeatedly displays "The object is an external reference" when mousing over an external reference. For example, if I use the Line command, and go to snap over part an external reference, the command line will display "The object is an external reference" when I mouse over any part of the reference, quickly filling up my command line box. This is particularly painful if I have just used the distance command, and am using the info straight out of the command line box. I have looked for xref commands that might be to blame, but have had no luck. Any thoughts? Thanks in advance!
  10. Is there one in autocad 2016? I just want to switch reference file on and off to see which ones I need to keep. Microstation had this excellent feature at least as far back as 1994. Has autocad caught up yet?
  11. Hi all! So, lets say I have drawing "A" as an xref in drawing "B". I then want to xref drawing "B" in drawing "C". If I don't want "A" to show up in "C", I simply make sure that it's an overlay not an attachment in "B". All good. Now let's say that there are also a bunch of pictures (jpeg files) xref'd into "B". If I don't want these showing up in "C", there doesn't appear to be the option to make them overlays like with dwg files. So, is it possible to xref a drawing that has xref'd images without pulling those along too? Thanks!
  12. Hey Everyone, Hope everyone is doing well. I was leery on posting this but I feel like the whole point of this forum is to share knowledge so hopefully I can be more efficent at my job. So, lets get started. I have to label contours that are in model space. I know that Civil 3D allows you to label contours that are in a surface but is there a way to label just regular polylines that are an XREF? The way that I currently do it is run the POLYLINE command snap to the contour, look at the properties to get the elevation, edit my text to the appropriate elevation, run my much appreciated LEE MAC LISP of Align Text to Curve and then I'm done. Done with ONE! Is there a way to expedite this without creating a surface? As always, any and all comments/questions are always appreciated. Regards, Miller
  13. lulumara

    X Bind

    Hi to all, I doing an xref to host drawings, tried to Xbind the xref but the problem said not found -- st_segment_lbl this is about Hydro which our company doing a removal of all Electrical post and underground placement of ducts. Our program use is AutoCad 2017. I follow all procedure but the Program kept looking for said about missing files? Any thoughts is appreciated Thanks.
  14. Hi, I have my xref-drawings with many layouts with even more viewports. In all these viewports i wanna show different kind of information and therefore i have to freeze some of the them, depending of what i want to show ofc. Now i just realized i have to change all my layer names from the orginal drawing, and when i do that all the freezed layers unfreezes in my xref viewports. for ex. All my layers starting with B_..... and now i wanna change that to X_... but i still wanna keep the layers frozen/unfrozen on the particular viewport in my xref-file. I Hope you guys understand what im trying to say and hopefully someone will save me from this ¤!%"&/ :)
  15. I was emailed a number of dwgs that have Xrefs, but from what I understand, I need access to the original/referenced dwgs? When I open my "External References" pallette, it shows "unreferenced", and "not found" references. The paths are to the customer's server? I think I'm missing the original file, but I'm new to this Xref, so I'm not confident that I'm doing everything right.
  16. Hi, I have a drawing that incorporates a number of Multileaders that consist of a rectangle with some text inside and a background mask. This drawing is then Xref'd into another drawing.The issue I'm having is that in the main drawing I have frozen some of these. However, the background mask is still showing on the plotted drawings. I've tried to "Select All" to see if something shows up in the drawing, but to no avail. Any ideas? Thanks.
  17. Hi I have a model with 3D walls, slabs, stairs ect. (AEC-objects). In that drawing I allso have an x-ref with some walls and solids and surfaces. When making a Vertical Section and enable Live Section, it only cuts through the objects in the main drawing - not the x-ref. How do I make it cut through the objects in the x-ref as well? Please help
  18. Hello Folks! Having problems with the UCS at the moment. I have rotated my drawings with the UCS command and used the plan command to set the drawings in the angle i want to view them in. And then used world to get the co-ordinate system true to its original state. The problem is when i am trying to attach the drawings together, they are in different places. Do you guys have any clues? (Sorry for my bad english) /Per-Anton
  19. mikeschawartskof

    Xref & Main Drawing

    I'm working in between the Xref and the Main drawing, but after I was done with the first Xref I noticed in the main drawing that is missing the created layers, for that reason, the view in the main drawing was completely wrong,even the created linetype didn't load to the main drawing. I attached a screen shot of the Xref and the main drawing. working with AutoCAD 2015.
  20. yport

    Lingering xref linetypes

    ACAD LT 2012 I have a problem where I somehow got a ton of xref line types in my template drawing. I must have inserted an object from another drawing into it that carried them. I don't have anything xrefed to the drawing. I've tried to delete them, but I get the message that I can't delete anything currently being used or in an xref. I've also tried copying with base point into another drawing. I went as far as copying individual items into a new drawing with the result being that the xref line types come into the other drawing. Any advice will be appreciated. Thanks, Yport
  21. bharris1987

    Help!

    So I was working on a cad sheet with an xref. Basically the xref exploded by itself and copied all the lines on to the actual drawing. There are bad linetype errors everywhere, and I cant open the file without it crashing on startup at the regenerating model phase. If i xref the drawing into a new dwg all the work i had done is there and is fine and dandy... so If anyone has any suggestions on how to proceed I am all ears.
  22. Hi, I have a list of Xrefs Xref_1 Xref_2 Xref_3_ELC Xref_4_ELC Xref_........ I want to modify the list to only include items that have_ELC at the end. even better would be if i could only add Xrefs to my list that have _ELC at the end. both attempts below do not succeed. any ideas? (defun c:findxref (/ td xrf) (setq XrfM nil) (while (setq td (tblnext "BLOCK" (not td))) (and (= (logand (cdr (assoc 70 td)) 4) 4) (setq xrf (cons (strcase (cdr (assoc 2 td))) xrf)) ) ) (print xrf) ;attempt with Vl-remove (foreach n xrf (if (/= (wcmatch n "*_ELC")T) (vlremove n xrf))) ;Create new list (foreach n xrf (if (= (wcmatch n "*_ELC")T) (append n xrfm))) (print Xrf) (print Xrfm) (princ) ) Thanks
  23. I was in the middle of freezing layers within an x ref I have for this drawing and for some reason I all of a sudden cannot select anything on the Xref at all. Is this a fluke or something? I tried turning on all layers and unlocking everything but to no avail. I can't do anything with it, please help. :x:x:x
  24. I need to produce a pdf in black/white/red. To achieve this I'm using a colour ctb but changing all the viewport layer display colours to white (except the linework that I need in red) and therefore print black. The problem linework is xref and seems to be either circles, rectangle or 3D polylines, that will not change their viewport display colour even though I have actually changed them to white? They just print their original colour.
  25. Hello, We xref and draw in Model Space then use viewports with title blocks scaled accordingly to the LTSCALE in Paper Space (i.e. 1"=50'-0" would have a setting of LTSCALE: 600). So this happens frequently....We receive a background from architect, civil engineer, etc.. and after cleaning up the background and then setting up our drawings, thus xref in the background; the linetypes from the xref get lost (i.e. say a dashed line will show continuous). Any help would be greatly appreciated!!
×
×
  • Create New...