XREF Reloading Programmatically

XREF Reloading Programmatically

Anonymous
Not applicable
497 Views
5 Replies
Message 1 of 6

XREF Reloading Programmatically

Anonymous
Not applicable
Can anyone point me in the right direction to be able to reload xref'd blocks via VBA? I need to reload them before I create a new plot in case the x-ref was changed after being referenced in. Thank you so much!
0 Likes
498 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Is this the best way? Dim curBLOCK As AcadBlock Dim myBlocks As AcadBlocks Set myBlocks = ThisDrawing.Blocks For Each curBLOCK In myBlocks If curBLOCK.IsXRef Then curBLOCK.Reload End If Next curBLOCK "Steven Craig Basham" wrote in message news:40058c3a$1_1@statler... > Can anyone point me in the right direction to be able to reload xref'd > blocks via VBA? I need to reload them before I create a new plot in case > the x-ref was changed after being referenced in. > > Thank you so much! > >
0 Likes
Message 3 of 6

Anonymous
Not applicable
This code works fine with this exception.... I receive an Automation error if the referenced file HAS been changed AND is still open. I modified the code to on error resume next and clear the error since do harm seems to come from it. But I'm sure that's not the right thing to do... any suggestions? "Steven Craig Basham" wrote in message news:4005908d_3@statler... > Is this the best way? > > Dim curBLOCK As AcadBlock > Dim myBlocks As AcadBlocks > Set myBlocks = ThisDrawing.Blocks > For Each curBLOCK In myBlocks > If curBLOCK.IsXRef Then > curBLOCK.Reload > End If > Next curBLOCK > > "Steven Craig Basham" wrote in > message news:40058c3a$1_1@statler... > > Can anyone point me in the right direction to be able to reload xref'd > > blocks via VBA? I need to reload them before I create a new plot in case > > the x-ref was changed after being referenced in. > > > > Thank you so much! > > > > > >
0 Likes
Message 4 of 6

Anonymous
Not applicable
Everyone - Here is a tip on using the discussion groups to your best advantage. Please do not change the subject line of discussion group messages to which you are replying. It breaks the ability of the search engine to group the messages, makes it harder to follow the thread and is quite confusing. If it is a new subject, please start a new message; if a reply, put your text answer in the body of your message and leave the header the same. Thanks for your future cooperation. -- Anne Brown Manager, Administrator Autodesk Product Support discussion groups Discussion Q&A: http://www.autodesk.com/discussion
0 Likes
Message 5 of 6

Anonymous
Not applicable
Anne, thank you for that information... I did not know that. :) Everyone else, I ran into another problem... some of my designer have xref's attached, but unloaded.... is there a propery you know of that allows me to check whether an xref is load or unloaded, so I can reload accordingly? Thank you so much for your time! "Steven Craig Basham" wrote in message news:40059871$1_2@statler... > This code works fine with this exception.... I receive an Automation error > if the referenced file HAS been changed AND is still open. I modified the > code to on error resume next and clear the error since do harm seems to come > from it. But I'm sure that's not the right thing to do... any suggestions? > > > "Steven Craig Basham" wrote in > message news:4005908d_3@statler... > > Is this the best way? > > > > Dim curBLOCK As AcadBlock > > Dim myBlocks As AcadBlocks > > Set myBlocks = ThisDrawing.Blocks > > For Each curBLOCK In myBlocks > > If curBLOCK.IsXRef Then > > curBLOCK.Reload > > End If > > Next curBLOCK > > > > "Steven Craig Basham" wrote in > > message news:40058c3a$1_1@statler... > > > Can anyone point me in the right direction to be able to reload xref'd > > > blocks via VBA? I need to reload them before I create a new plot in > case > > > the x-ref was changed after being referenced in. > > > > > > Thank you so much! > > > > > > > > > > > >
0 Likes
Message 6 of 6

Anonymous
Not applicable
Check for the curBLOCK.count > 0 If an Xref has been inserted into a drawing and then is unloaded, the count will be 0. Jeff "Steven Craig Basham" wrote in message news:4005aa0f$1_2@statler... > Anne, thank you for that information... I did not know that. :) > > Everyone else, I ran into another problem... some of my designer have > xref's attached, but unloaded.... is there a propery you know of that > allows me to check whether an xref is load or unloaded, so I can reload > accordingly? > > Thank you so much for your time! > > "Steven Craig Basham" wrote in > message news:40059871$1_2@statler... > > This code works fine with this exception.... I receive an Automation error > > if the referenced file HAS been changed AND is still open. I modified > the > > code to on error resume next and clear the error since do harm seems to > come > > from it. But I'm sure that's not the right thing to do... any > suggestions? > > > > > > "Steven Craig Basham" wrote in > > message news:4005908d_3@statler... > > > Is this the best way? > > > > > > Dim curBLOCK As AcadBlock > > > Dim myBlocks As AcadBlocks > > > Set myBlocks = ThisDrawing.Blocks > > > For Each curBLOCK In myBlocks > > > If curBLOCK.IsXRef Then > > > curBLOCK.Reload > > > End If > > > Next curBLOCK > > > > > > "Steven Craig Basham" wrote in > > > message news:40058c3a$1_1@statler... > > > > Can anyone point me in the right direction to be able to reload xref'd > > > > blocks via VBA? I need to reload them before I create a new plot in > > case > > > > the x-ref was changed after being referenced in. > > > > > > > > Thank you so much! > > > > > > > > > > > > > > > > > > > >
0 Likes