Data Shortcut with API

Data Shortcut with API

joantopo
Mentor Mentor
6,605 Views
18 Replies
Message 1 of 19

Data Shortcut with API

joantopo
Mentor
Mentor

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
0 Likes
Accepted solutions (1)
6,606 Views
18 Replies
Replies (18)
Message 2 of 19

Jeff_M
Consultant
Consultant
Accepted solution
Not at this time. Data Shortcuts/References have not been exposed in the API.
Jeff_M, also a frequent Swamper
EESignature
Message 3 of 19

joantopo
Mentor
Mentor

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
0 Likes
Message 4 of 19

Anonymous
Not applicable
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?
0 Likes
Message 5 of 19

ralstogj
Collaborator
Collaborator

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/
0 Likes
Message 6 of 19

ralstogj
Collaborator
Collaborator

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/
0 Likes
Message 7 of 19

Jeff_M
Consultant
Consultant
Nothing new that I am aware of.
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 8 of 19

ralstogj
Collaborator
Collaborator
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 [email protected] │ 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/
0 Likes
Message 9 of 19

drewj
Enthusiast
Enthusiast

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

0 Likes
Message 10 of 19

Civil3DReminders_com
Mentor
Mentor

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
0 Likes
Message 11 of 19

MehtaRajesh
Advocate
Advocate

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

0 Likes
Message 12 of 19

Jeff_M
Consultant
Consultant

@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 19

MehtaRajesh
Advocate
Advocate
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
0 Likes
Message 14 of 19

Jeff_M
Consultant
Consultant

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

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

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 15 of 19

treforfjones
Contributor
Contributor

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

 

 

0 Likes
Message 16 of 19

ebikoba
Explorer
Explorer

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

0 Likes
Message 17 of 19

Jeff_M
Consultant
Consultant

@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 19

BlackBox_
Advisor
Advisor

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

Chris (BlackBox) Bradley
Managing Partner / Developer / Civil Designer
Quux Software | Sincpac C3D | Style Explorer

Message 19 of 19

csandersonGKMZ9
Contributor
Contributor

Hi @Jeff_M, wondering if this is still the case? Trying to automate a couple things to accommodate changes with our company's file system


Sorry, please disregard, parsed through some of the above code a bit more and got my answer!

0 Likes