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

ACAD MEP: Catalog Editor API

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
harryliu3140
1052 Views, 8 Replies

ACAD MEP: Catalog Editor API

I can use Catalog Editor to edit MvPart's connection parameters (as shown in attached screen shot). Are there any APIs for me to use in my VB.net program so I can edit position, size of connection automaticaly? Thank you.

 

Catalog Editor

8 REPLIES 8
Message 2 of 9
Keith.Brown
in reply to: harryliu3140

Look in the C:\Program Files\Autodesk\AutoCAD 2016\Sample\VB.NET and C:\Program Files\Autodesk\AutoCAD 2016\Sample\CS.NET directories.  There are plenty of samples that do this.

 

There are projects in the CS directory that are not in the VB directory.  

Message 3 of 9
harryliu3140
in reply to: Keith.Brown

Wow, I will be a minecraft to dig into it. Thank you so much for the direction.

Message 4 of 9
harryliu3140
in reply to: Keith.Brown

Hi, Keith

 

I went through the sample of CatalogExplorer and learned how to read information from the xml file. Then I went through another sample of AddToCatalog to see how to add new parts to the xml file. The samples are easy to understand and really lead me into this temple of multi-view part. I want to create new block-based parts and add connection to them. This work is more complex than the sample which adds new duct. If you know any link can lead me ahead please let me know. Your guidance is appreciated.

 

Thank you,

Harry

Message 5 of 9
harryliu3140
in reply to: harryliu3140

It seems the sample of CreateDeviceStyle is what I'm looking for. Keep digging.

Message 6 of 9
Keith.Brown
in reply to: harryliu3140

I am not 100% positive that the API will allow you to create new catalog block based mvparts as I have never tried.  I know 100% that the runtime catalog will not.  However, if you look at the xml file for a block based part you can just create that file through standard .net code.

 

If you look at the ConvertToMvPart example, it will show you how to create a mvpart that only exists in the drawing.  I did not look over the device style code very much but it looks like it is doing something similar.  Only creating the device style in the current drawing.

 

I cannot share the code but if you look on the app store, I have an app for free that is called Access Space Generator.  What it does is create a block programatically and then convert it to a mvpart and then anchor the access space (as an mvpart) to an existing mvpart.  So if you move it or rotate it the access space will move with the mvpart.  I got the idea from the ConvertToMvpart sample.

Message 7 of 9
harryliu3140
in reply to: Keith.Brown

Hi, Keith

 

I go through the sample of AddToCatalog, seems the sample is to add new ducts to the current catalog. But when the program want update the APC file error raised "Unable to write to APC file":

error.png

 

' Save the raw table to write the changes we have made back to the xml file and update the Catalog 
mCatalog.AddRawPartTable(dpl.Domain, dpl, rawTable, True)
' This updates the APC file directly with the new entry...
mCatalog.AddCatalogPartEntry(dpl.Domain, newXmlPath, rawTable) <-- Error at here

 

If the program really can update the APC file of duct then I think it can update APC file of block-based mvpart.

 

I notice the Catalog Editor can open APC file and make changes and save. How can I open APC file with .net code?

 

Regards,

Harry

Message 8 of 9
Keith.Brown
in reply to: harryliu3140

Check your permissions on the folder where the apc folder is located.

I would be interested in knowing if you get everything working well with block based parts!
Message 9 of 9

Hi Sir,

Is there a way to add items to the Plant 3D Spec Editor catalogs via API.

Request to advise your feedback.

Thankyou

Sruthi

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