Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Data Shortcut with API

17 REPLIES 17
SOLVED
Reply
Message 1 of 18
joantopo
1973 Views, 17 Replies

Data Shortcut with API

Hi.

 

I want to do this:

 

* I have a current drawing file, called such as "dwg1"

 

- Create a new database. (OK).

-Create a new TinSurface (surface2) in that database (OK)

-Add definitions in that surface: (with CoGO Points and a boundary)  (OK).

-Create a new drawing file, called "dwg2" (OK).-assign that database in that drawing file, dwg2. (OK) - create "data short cut" in dwg2.-Use in dwg1 the surface2 like external data using Data Short cut. Can I make this? Thanks in advance. 

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
17 REPLIES 17
Message 2 of 18
Jeff_M
in reply to: joantopo

Not at this time. Data Shortcuts/References have not been exposed in the API.
Jeff_M, also a frequent Swamper
EESignature
Message 3 of 18
joantopo
in reply to: Jeff_M

Thanks.

 

I am going to make it in the current drawing then, although I have a great idea: instead of using CoGO points, I´m going to use "Point surface" so this way I avoid to create COGO points in the same drawing that it is I wanted.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Message 4 of 18
Anonymous
in reply to: Jeff_M

This post is the latest I could find on this subject and it's 15 months old. Any new word concerning if/when Autodesk might be releasing shortcut functions to the API?
Message 5 of 18
ralstogj
in reply to: Anonymous

Guys

 

Just wanting to know if there has been any progress on this and if you can at least what references a specific dwg is using.

 

Regards

 

Justin

Regards

Justin Ralston
http://c3dxtreme.blogspot.com/
Message 6 of 18
ralstogj
in reply to: Anonymous

Guys

 

Just wanting to know if there has been any progress on this and if you can at least find what references a specific drawing is using.

 

Regards

 

Justin

Regards

Justin Ralston
http://c3dxtreme.blogspot.com/
Message 7 of 18
Jeff_M
in reply to: ralstogj

Nothing new that I am aware of.
Jeff_M, also a frequent Swamper
EESignature
Message 8 of 18
ralstogj
in reply to: Jeff_M

Ok thanks Jeff.

Regards


[airey]

Justin Ralston
Senior Engineer - Manager Queenstown

AIREY CONSULTANTS LTD
P.O.Box 2069, Wakatipu, Queenstown, 9349│ Level 2, Von House, Remarkables Park
Ph +64 3 442 3101 │ Fax +64 3 442 3102 │ Mob +64 274 566 660
Email justinr@aireys.co.nz │ Web www.aireys.co.nz<>

The information contained in this email is privileged and confidential and intended for the addressee only. If you are not the intended recipient, you are asked to respect that confidentiality and not disclose, copy or make use of its contents. AIREY CONSULTANTS LIMITED ACCEPTS NO RESPONSIBILITY FOR CHANGES MADE TO THIS EMAIL OR ANY ATTACHMENTS AFTER TRANSMISSION FROM AIREY CONSULTANTS LTD. If received in error you are asked to destroy the email and contact the sender immediately.
P Please consider the environment before printing this email.
Regards

Justin Ralston
http://c3dxtreme.blogspot.com/
Message 9 of 18
drewj
in reply to: Jeff_M

Hi Jeff,

 

Is this still the case?

 

I am looking to promote, I couldn't get the PROMOTEALLREFERENCES to work so I tried finding all the references, for example:

 

ObjectIdCollection SurfaceIds = CivDoc.GetSurfaceIds();
foreach (ObjectId surfaceId in SurfaceIds)
{
CivSurface oSurface = surfaceId.GetObject(OpenMode.ForRead) as CivSurface;
if(oSurface.IsReferenceObject == true)
{

//PROMOTE THEM HERE

}

}

 

I just cant figure out what to put in to do the promoting 🙂

 

Thanks for anything you know on this topic.

 

Regards,


Drew

Message 10 of 18

Create surface

Create(String, ObjectId)

then paste the surface you want "promoted" into the new surface. PasteSurface

CreateSnapshot

Delete "promoted" surface.

Rename the new surface to the name of the "promoted" surface. 

 

Not a direct promote via the API, but it should give you the same results as promoting a surface using the UI. 

 

 

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 11 of 18
MehtaRajesh
in reply to: joantopo

Hello,
Does Autodesk exposed Data Short Cuts API to developers. 
Appreciating the update from Autodesk.
It is worth if we have access of data short cuts to developers to join the broken reference using our functions.
Regards,

Rajesh

Message 12 of 18
Jeff_M
in reply to: MehtaRajesh

@MehtaRajesh Yes, C3D 2020 exposed the DataShortcuts/Drefs in the .NET API.

2022-03-28_7-34-00.png2022-03-28_7-32-43.png

Jeff_M, also a frequent Swamper
EESignature
Message 13 of 18
MehtaRajesh
in reply to: Jeff_M

Thanks Jeff for your quickest reply.
I will check with your suggested way and try to fix broken links for data short cuts.
Regards,
Rajesh
Message 14 of 18
Jeff_M
in reply to: MehtaRajesh

@MehtaRajesh There is also the DataShortcutManager in the AeccDataShortcutMgd assembly.

2022-03-29_6-44-26.png

Jeff_M, also a frequent Swamper
EESignature
Message 15 of 18
treforfjones
in reply to: Jeff_M

Hi Jeff,

Long time no speak.

Again many thanks for the assistance you provided

in cracking the basics of vb and c# .

Salient point choose C#  over vb

I took a year off from coding, (in computing terms

my hard drive was full and I wasn't sure about

the backup.

On reboot, just like an old pc you haven't used for years

it still works but boy does it creak.

With regards to message is this still the case

regards

Trefor

 

 

Message 16 of 18
ebikoba
in reply to: Jeff_M

How do you go about geting the source drawing path of a data referenced object?

Message 17 of 18
Jeff_M
in reply to: ebikoba

@ebikoba In my response above (message #12) I show the method and properties needed to get the source drawing.

 

                            Entity ent = tr.GetObject(oId, OpenMode.ForRead, false) as Entity;
                            var civEnt = ent as CivDb.Entity;
                            if(civEnt.IsReferenceObject && civEnt.IsReferencedSourceExisting)
                            {
                                var refInfo = civEnt.GetReferenceInfo();
                                var sourceDwg = refInfo.SourceDrawing;
                            }
Jeff_M, also a frequent Swamper
EESignature
Message 18 of 18
BlackBox_
in reply to: Jeff_M

Love it when two lines of code replace an Entity.GetReferencePath() extension method from 2018 that iterates XML files based on AssociateShortcutProjectId (UUID), to locate the DREF Source drawing's file path. Haha

 

https://forums.augi.com/showthread.php?157034-NET-API-functions-to-interrogated-Civil-3D-drawings-fo...



"How we think determines what we do, and what we do determines what we get."

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report