I'd like understand better how to deal with SelectionObj in SelectionSets..
How do i classify SelectionObj(s) as specific entities , like line2d,, so I can utilize them better with line2d methods..
would be better if i could prompt for lines and only allow lines for selection? is there such a function or do i program a IF that checks selectionSet and message user if some objects was not a linetype
my concept understanding is to:
for each selectionOBJ in selectionSET
trycast selectionObj.getobjectType, line2d
does that make sense?
i dont know how id put that in vb code.. if even possible. please point me in a direction. 'forgive my noobness
You want to learn to use selection set filters.
There is a AutoCAD .NET Developer’s Guide available as a Pdf which has many samples of using selection set filters.
I could not find a link for the Pdf, maybe someone else can provide you a link.
It looks like you're confusing Autodesk.AutoCAD.Gemometry.Line2d (which is a geometric object without graphic representation and which can't be select) with Autodaek.AutoCAD.DatabaseServices.Line (which is the graphic object you can select).
See this thread:
ok thx fxcastil i looked at selection filters it will help me.
I see what u mean with difference in databaseservice vs. geometery objects
my goal: is to get a selection of lines. then access each individual lines X & Y (@endPoint) coordinates and change them individually.
I prompt for a Start point (which will not change x & y) ,, then i need to name this line and proceding lines in order,, like 1-2 ,2-3, 3-4 ect. These lines will almost close back onto the Start point.
from here, I calculate the distance in x & y needed for closure and adjust all the lines individually (but in proportion) so that they close a polygon.
THE MAIN idea is i need to read Start and End points on the selected lines INdividually and change with some calculated variables.
the calculations i can code myself. im comfortable enough with vb.net.. i just need to access some values.
IN Geomatics Engineering we call this "Compass Rule Adjustment"
I choose this as my starting project to learn Autocad.net programming.
Later i will do more complex projects for least square adjustments.
my problem i have a selectionSET of SelectionObj(s) .. (which i filter) so i know they are definitly lines
How do i classify them as such so i can access the X&Y properties to change them..
or How would YOU do this project?
not show me excatly, just some direction would help me learn myself.
I do have developer's Guide but it can be sometimes obscure for a new learner.
thanks in advance
my idea is to check each selected line IF Start coodinates = PrompPointResult.x and PrompPointResult.y THEN
that line.id = "1"
check IF line.id("1").x and line.id("1").y = check each selected line for match THEN label that match line.id = "2"
but how to syntax
YES i solved my own problem, sry to waste your time guys
For Each obj As SelectedObject In MySelectedSet
Dim ent As Entity = trsAct.GetObject(obj.ObjectId, OpenMode.ForRead)
Dim line As Line = ent
with the line variable i have access to X Y coordinates of lines start point and more methods related to lines specifically
from here things get easier.
now i just need to figure out how to give each line its own name.. it will be much more convienent than as refering to Ojectids.. blockName? no readonly
what is line.ownerId?
I think this is where dictionary comes to play. because there is no property to name my line i can perhaps attach a xrecord to the line's extentionDictionary and if i need that line , i can call it refering to the saved xrec.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.