Dimension style c3d

Hello!
I want to create an automatic label composed by rotated dimension, but i need to define a new dimension style. Its there a way to create one?
I am also interested in text style.

Thank you!

Well first, what have you tried this far?

Yes i read that.
What you don t understand?
I ask about it is posible to create a node for defining a dimension style and a text style.(for autocad/c3d)
I was search on the forum and on the internet, but i didn t find anything.
I think is a package who has that node, but i don t know where to find that…

I haven’t seen a node for it, but I also am not sure one would be required.

Try getting an existing one, and editing it. That will tell us what the possible limits are.

If you have the style already in another source drawing (likely knowing most firms) then you could also try inserting an object from the other drawing and see if the dim style transfers over.

1 Like

Yes, you didn’t wrote anything about that you have searched or tested anything. You only asked the forum if it where possible to create a style for text and dimension.

Well, whatever.

I haven’t seen any node how to create what you ask for but I know that there is a possibility to add text to a leader and a dimension using dynamo

1 Like

convert code to python


DimStyleTable dimStyleTable = (DimStyleTable)acTrans.GetObject(acCurDb.DimStyleTableId, OpenMode.ForWrite);
                DimStyleTableRecord dimStyleTableRecord = null;
                if (dimStyleTable.Has(name) == false)
                {

                    if (dimStyleTable.IsWriteEnabled == false)
                        dimStyleTable.UpgradeOpen();
                    dimStyleTableRecord = new DimStyleTableRecord();
                    dimStyleTableRecord.Name = name;
                    dimStyleTable.Add(dimStyleTableRecord);
                    acTrans.AddNewlyCreatedDBObject(dimStyleTableRecord, true);
                }
                else
                {
                    dimStyleTableRecord = acTrans.GetObject(dimStyleTable[name],
                        OpenMode.ForWrite) as DimStyleTableRecord;
                }

// https://forums.autodesk.com/t5/net/creating-dimension-styles/m-p/3604984
2 Likes

convert code to python

//https://forums.autodesk.com/t5/net/create-non-existant-text-style/m-p/9185596

Public Function CreateTextStyle(ByVal stylename As String, ByVal filename As String, ByVal bgfilename As String, ByVal textheight As Double, ByRef trans As Transaction) As ObjectId
        Dim id As ObjectId = Nothing
        Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
        Try
            Dim tst As TextStyleTable = DirectCast(trans.GetObject(db.TextStyleTableId, OpenMode.ForRead, False), TextStyleTable)
            Using ts As New TextStyleTableRecord()
                ts.Name = stylename
                ts.FileName = filename
                If bgfilename <> String.Empty Then
                    ts.BigFontFileName = bgfilename
                End If
                ts.TextSize = textheight
                ts.XScale = 1.0
                tst.UpgradeOpen()
                tst.Add(ts)
                trans.AddNewlyCreatedDBObject(ts, True)
                id = ts.ObjectId
            End Using
        Catch ex As Exception
            MsgBox(Reflection.MethodBase.GetCurrentMethod.Name() + " Exception: " + ex.Message)
        End Try
        Return id
    End Function
2 Likes