Showing posts with label Autocad custom applications. Show all posts
Showing posts with label Autocad custom applications. Show all posts

Saturday, 30 September 2017

Autocad custom apps : DBtext rotation angle

Well, always the same problem when it is time to code for angles.
Where is the zero, what direction, what units...

This is for the Autodesk.Autocad.Database.DBtext (single line text)
Here is the code for this case

        Dim AngleIs As Double
        AngleIs = CDbl(Me.tbAngle.Text) 'angle got in Gradians from a text box
        AngleIs -= 100 'Gradians i said
        AngleIs = -AngleIs
        AngleIs = AngleIs * math.PI/200 'Gradians i said

Units : radians
Direction : CounterClockWise
Zero : Positive X axis

Autocad custom apps : Block entities assignment cases

A block can add Entities using two methods.

block.AppendEntity(entity)
Entities created and added immediately in the block, not the BlockTable

block.AssumeOwnerShipOf(CollectionOfObjectIDs)
Entities are already created and exist in the BlockTable. If not copied then after commiting transaction they dissapear from the Model/Paper Space blocks and they "live" only in the block !

I had a hard time trying to configure how to do the second case. Adding existing entities to a block. All examples i found were for the first case.