.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

link a sheetset view to a block reference

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Allen_Hart
544 Views, 6 Replies

link a sheetset view to a block reference

I'm trying to write a vb.net addin to link a sheet set view to a callout block or label block reference already in the drawing. I want to be able to select a view from my list of views and link it to selected block references. The view list dialog and block selection parts are done; just cannot figure out how to make the link.

 

Does anyone have some example code to show how a sheetset view is linked to a block reference?

 

Many thanks for any help,

Allen

 

 

6 REPLIES 6
Message 2 of 7
Balaji_Ram
in reply to: Allen_Hart

Hi Allen,

 

From what I understand, such linking will need a Field to be created in the callout block that acts as a hyperlink to the SheetView.

 

I have attached a screenshot to show this option in AutoCAD UI. Is this what you are trying to do through code or some other option in AutoCAD that does such linking already ?  

 

If you can please share screenshots in AutoCAD to do that, I can investigate that further. 

 

Regards,

Balaji

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 3 of 7
Allen_Hart
in reply to: Balaji_Ram

Hi Balaji,

 

I'm not sure that hyperlink is what I'm looking for. I'm trying to mimic what the SSM does when I place a callout, or a view label, in the drawing. By that I mean I want to repair a broken connection between the SSM and one of its callout block references. For example, sometimes I need to delete a view from one layout (sheet) and place it on another. Doing so causes any callout for that view to display ##### as the field value. So instead of manually deleting the broken callout and placing a new one, I thought I would write an addin to repair it or "relink" it to the SSM view. I can't figure out how to do that. Nor can I figure out how to programmatically replace the broken callout with a new one.

 

The attached screen capture shows my addin running next to the SSM tool palette. In the drawing area there is a broken view label and a broken detail callout because view 01 on sheet 2.01 has been deleted. And for the sake of example, I added the two blocks to act as placeholders in the drawing. I would like to be able to apply the sheetset view to these blocks as well.

 

So is it better to have the addin repair the connection to the selected callout, or to have it delete the selected callout and replace it with a new one? Either way, how do you do it?

 

Thanks

Allen

 

Message 4 of 7
jeff
in reply to: Allen_Hart

SheetSet file is just an XML file here is link with more info

http://www.theswamp.org/index.php?topic=46497.0

 

 

But what it is basiclly doing is adding a field and here is pic of how to do it manully in some text using sample sheet set file that comes with installation

 

Capture.PNG

You can also find your answers @ TheSwamp
Message 5 of 7
Balaji_Ram
in reply to: Allen_Hart

Yes, As Jeff mentioned recreating the fields should help.

 

You can get the field using the AttributeReference.GetField method and then change the field code using "SetFieldCode".

To ensure that the field is evaluated based on the new field code, use the "Evaluate" method.

 

The field code will need to be created just as the Field dialog does. To get the Guid of the SheetSet and sheet similar to what is displayed in the Field dialog, you can use “.GetObjectId().GetHandle()” on the SheetSet and Sheet. 

 

Regards,

Balaji

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 6 of 7
Allen_Hart
in reply to: Balaji_Ram

Thanks guys,

 

Actually, my first thought was to work on the field code but could not find a API function to create it.  Maybe now I have enough info from you guys to recreate the field code myself.

 

If I get stuck again...I'll be back Smiley Happy

 

Allen

 

Message 7 of 7
Allen_Hart
in reply to: Allen_Hart

Woo Hoo! got it working.  Thanks for all the help.

 

Although, I do wish there was a better way to update the display of the modified block references on screen besides Editor.Regen(), which causes the screen to blink on-and-off each time it is used. Annoying, but it works.  Is there another method I can try?

 

I tried the solution discussed here but could not get it to work for me...

"http://forums.autodesk.com/t5/NET/Redrawing-the-screen-during-execution-of-a-Command-Method/m-p/3740...

 

Thanks,

Allen

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost