Jump to content

Search the Community

Showing results for tags 'xref'.



More search options

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

Found 99 results

  1. 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
  2. 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.
  3. 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))) )
  4. Hi guys, Long time reader, seldom if ever poster. I think I've got a good one this time and can't find a solution. I'm seeking to find and replace strings in hundreds of xref paths. It's not the path I need to change, but a string in the name of the drawing. For example: "otl" should be found and replaced with "int" *\PLANS\p_otl_001.dwg -> *\PLANS\p_int_001.dwg *\PLANS\p_otl_002.dwg -> *\PLANS\p_int_002.dwg I can quickly change the reference name using RENAME and the Reference Manager can change all paths, but affects only the file path and not the name of the drawing. REDIR with * wildcards doesn't work either. I've searched for hours for a script that will achieve this but I cannot seem to find one. Has anyone found a solution to this before? (I'll buy you many beers first chance I get.) Using AutoCAD Architecture 2012.
  5. 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!
  6. 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" ) )
  7. 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?
  8. Hi all, I get a pop-up in the middle of a e-transmit saying "Etransmit creation failed!". It's only happening with one file. I've done purge all, audit, rebooted computer,etc. I did the same with the attached xref. The xref are also located in other files that I have no problem with e-transmit, so I doubt their the problem. If anyone has a clue what causes this it would be helpful.
  9. 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!
  10. 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
  11. AutoCAD 2012. Simple nothing else. This has happened to me once before and my manager and I figured it out by accident over a year ago/work around. We don't remember why it happened so here's hopping someone else knows this issue. Basically I have a drawing where I XREF a drawing model in as "Attachment or Overlay" and place it anywhere and some of the XREF'd modeled objects stays at 0,0,0 while the rest is where ever I placed it... If I use the move command like I want to. The objects in the XREF still moves like normal but those objects at the 0,0,0 origin stay. -In the original model I'm XREF'ing in... I deleted a part and put a new part in and saved it.... It still stuck at 0,0,0 -I tried removing and purging but to no help. -XCLIP off don't work. -Saving with the same 2007 AutoCAD formats don't help. -Character Length of file path isn't an issue. -I XREF'd other models in and they are fine.
  12. 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.
  13. 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 ¤!%"&/ :)
  14. 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.
  15. 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.
  16. 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
  17. 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
  18. 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
  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. will there ever be a day where inserting a pdf underlay into autocad doesn't slow it down or am I doing something wrong? I would rather not degrade the quality and make it a jpg
  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. Hi everyone, Ive made a tool to cleanup your dwg-drawings: CLEAN UP XREF V1.1 I want to share it, to help each other! Send me your comment! You can download it below. It contains the follow functions: '************************************************************************ '--- SET_UP_DRAWING --- '1 UCS_WORLD '1 PLANVIEW_UCSWORLD '2 SET_UP_VARIABLES '2 SET_UP_UNITS '3 SCALE_DRAWING '4 LTSCALE_ALL_EXCLUDE_BLOCKS (30) 'WAARDE VAN LTSCALE MEEGEVEN '5 LTSCALE_ALL_BLOCKS (15) 'WAARDE VAN LTSCALE MEEGEVEN '6 FLATTEN_DRAWING '--- SET_UP_LAYERS --- '7 STORE_LAYERSTATE '8 RESTORE_LAYERSTATE '9 SET_LAYER_XREF_TEMP_CURRENT '10 ALL_LAYERS_ON '11 UNLOCK_ALL_LAYERS '12 UNFREEZE_ALL_LAYERS '13 LAYERS_LINEWEIGHT_DEFAULT '14 REMOVE_LAYER_FILTERS '--- CLEANING_STUFF --- '15 PURGE_DRAWING '16 AUDIT_MODELSPACE '17 DELETE_LAYOUTS '18 DELETE_VIEWPORTS '19 DELETE_VIEWS '20 DELETE_DIMENSIONS '21 CLEAN_SCALELIST '--- LAYER_STUFF --- '22 CLEAR_LAYER0 ' DELETE_LAYER ("E-61-ELEKTRISCHE BORDEN") 'HIER DIEN JE NAAM VAN LAYER IN TE VULLEN '23 DELETE_FROZEN_LAYERS '24 ALL_BY_LAYER1 '25 ALL_BY_LAYER2 '--- BLOCKS_STUFF --- '26 ALL_BLOCKS_BY_LAYER '27 BURST_EXPLODE_BLOCKS '28 BURST_EXPLODE_DRAWING_DOWN (3) '29 FIX_BLOCK '--- XREF_STUFF --- '30 TRY_TO_RELOAD_ALL_XREFS_UNLOADED '31 TRY_TO_DETACH_ALL_XREFS_UNLOADED '32 BIND_AND_EXPLODE_ALL_XREFS_LOADED '33 DELETE_UNLOADED_IMAGES '--- EXPORT_STUFF --- '34 CREATE_BACKUP_FILE ' SAVE_AS_XREF ' CREATE_WBLOCK '35 COPY_INTO_TEMPLATE '************************************************************************ Help each other to be helped! CLEAN_UP_XREFSv1.1.zip
  24. 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
  25. 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.
×
×
  • Create New...