Open Text Editor for Single Line Text(DBText)

Open Text Editor for Single Line Text(DBText)

Anonymous
Not applicable
1,930 Views
9 Replies
Message 1 of 10

Open Text Editor for Single Line Text(DBText)

Anonymous
Not applicable

I have a plugin that selects only DBText using a filter. I want to open the text editor when I select the DBText.

 

 Dim acent As DBText = acTrans.GetObject(acSSObj.ObjectId, OpenMode.ForWrite)

 

I want to call the Text Editor in this DB Text.

 

What command do I use to open the text editor for the DBText?

 

Thanks in advance!

0 Likes
Accepted solutions (1)
1,931 Views
9 Replies
Replies (9)
Message 2 of 10

FRFR1426
Collaborator
Collaborator

 

ed.Command("_.TEXTEDIT", acSSObj.ObjectId)

where ed is a reference to the document editor object.

 

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 3 of 10

Anonymous
Not applicable
I already tried that but it doesn't work.

Thank you for your effort, I have found the solution.
0 Likes
Message 4 of 10

Anonymous
Not applicable
Accepted solution

I have answered my own question, as usual! Haha

 

Dim acent As DBText = acTrans.GetObject(acSSObj.ObjectId, OpenMode.ForWrite)
Dim ids As ObjectId() = New ObjectId(-1) {}
InplaceTextEditor.Invoke(acent, ids)

 

That command invokes the InPlaceText Editor on the Object you call.

 

Any Kudos? Hehe

Message 5 of 10

FRFR1426
Collaborator
Collaborator

One Kudo for sharing with the community

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 6 of 10

Anonymous
Not applicable
Thanks man!
0 Likes
Message 7 of 10

Anonymous
Not applicable

Can someone please explain this line of code

 

Dim ids as ObjectId() = New ObjectId(-1) {}

 

It's to do with the InplaceTextEditor.Invoke command.

 

Thanks in advanced

 

Steven Houghton

0 Likes
Message 8 of 10

_gile
Consultant
Consultant

Hi,

 

This is an empty ObjectId array which is required as reference parameter by InPlaceEditor.Invoke() method.

 

C# signature:

public static void Invoke(DBText text, ref ObjectId[] appendedEntities);

VB signature:

Public Shared Sub Invoke(text As DBText, ByRef appendedEntities As ObjectId())


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 9 of 10

Anonymous
Not applicable

I understand the Objectid() variable, but  what I'm interested in the ObjectId(-1) {}, this must select the last,  current or previous item?

 

Thanks

 

Steven Houghton

0 Likes
Message 10 of 10

_gile
Consultant
Consultant

This is one of the different ways to create an empty array with VB.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes