- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone!
I am working on a LISP routine to auto-align multiple attributes in a single row in a block, so that when a user has filled out the attributes, they can then run my LISP routine to auto-align the text so that it doesn't overlap.
I have successfully created lists of the attributes I need and now am coding the alignment part. Basically, I want to call JUSTIFYTEXT middle right on the leftmost attribute, JUSTIFYTEXT middle left on the second attribute, get the Alignment X-coordinate of the leftmost attribute, set the Alignment X-coordinate of the second attribute equal to that of the leftmost attribute, and repeat this down the chain, setting the justifications for each attribute back to their original values when I'm finished.
However, the program gives me an ADS request error at the line below, where I try to grab the "AlignmentPoint/X" of an attribute so that I can manipulate it later.
(setq coordNumber (getpropertyvalue (nth inc delimList) coordName))
I have verified through print statements that ...
- coordName is the string "AlignmentPoint/X" (without the quotations)
- inc is 0
- The first value in delimList is the entity name of the attribute I want. I verified this by calling getpropertyvalue on the entity name to see the Tag.
I then ran the dumpallproperties command on the entity name of the attribute, and I think my problem is that the AlignmentPoint values aren't reading through for some reason. I pasted the whole property dump below if that helps, but the AlignmentPoint values all say "Failed to get value". Can I not access the AlignmentPoint values if the attribute is within a block? If so, I don't know if I can accomplish what I want to do.
Begin dumping object (class: AcDbAttribute)
AlignmentPoint/X (type: double) (RO) (LocalName: Text alignment X) = Failed to get value
AlignmentPoint/Y (type: double) (RO) (LocalName: Text alignment Y) = Failed to get value
AlignmentPoint/Z (type: double) (RO) (LocalName: Text alignment Z) = Failed to get value
Annotative (type: bool) (LocalName: Annotative) = 0
AnnotativeScale (type: AcString) (RO) (LocalName: Annotative scale) = Failed to get value
BlockId (type: AcDbObjectId) (RO) = 1cee5ec6900
CastShadows (type: bool) = 0
ClassName (type: AcString) (RO) =
CollisionType (type: AcDb::CollisionType) (RO) = 1
Color (type: AcCmColor) (LocalName: Color) = BYLAYER
ExtensionDictionary (type: AcDbObjectId) (RO) = 0
FieldLength (type: int) = 0
FlowDirection (type: AcDbMText::FlowDirection) (RO) (LocalName: Direction) = 5
Handle (type: AcDbHandle) (RO) = 1a138
HasFields (type: bool) (RO) = 0
HasSaveVersionOverride (type: bool) = 0
Height (type: double) (LocalName: Height) = 0.200000
HorizontalMode (type: AcDb::TextHorzMode) = 1
Hyperlinks (type: AcDbHyperlink*)
Invisible (type: bool) (RO) (LocalName: Invisible) = 0
IsA (type: AcRxClass*) (RO) = AcDbAttribute
IsAProxy (type: bool) (RO) = 0
IsCancelling (type: bool) (RO) = 0
IsDefaultAlignment (type: bool) (RO) = 0
IsEraseStatusToggled (type: bool) (RO) = 0
IsErased (type: bool) (RO) = 0
IsMTextAttribute (type: bool) (RO) (LocalName: Multiple lines) = 0
IsMirroredInX (type: bool) (LocalName: Backward) = 0
IsMirroredInY (type: bool) (LocalName: Upside down) = 0
IsModified (type: bool) (RO) = 0
IsModifiedGraphics (type: bool) (RO) = 0
IsModifiedXData (type: bool) (RO) = 0
IsNewObject (type: bool) (RO) = 0
IsNotifyEnabled (type: bool) (RO) = 0
IsNotifying (type: bool) (RO) = 0
IsObjectIdsInFlux (type: bool) (RO) = 0
IsPersistent (type: bool) (RO) = 1
IsPlanar (type: bool) (RO) = 1
IsPreset (type: bool) (RO) = 0
IsReadEnabled (type: bool) (RO) = 1
IsReallyClosing (type: bool) (RO) = 1
IsTransactionResident (type: bool) (RO) = 0
IsUndoing (type: bool) (RO) = 0
IsVerifiable (type: bool) (RO) = 0
IsWriteEnabled (type: bool) (RO) = 0
Justify (type: AcDbText::AcTextAlignment) (LocalName: Justify) = 10
LayerId (type: AcDbObjectId) (LocalName: Layer) = 1cee5eb7d50
LineWeight (type: AcDb::LineWeight) (LocalName: Lineweight) = -1
LinetypeId (type: AcDbObjectId) (LocalName: Linetype) = 1cee5ec6a10
LinetypeScale (type: double) (LocalName: Linetype scale) = 1.000000
LocalizedName (type: AcString) (RO) = Attribute
LockPositionInBlock (type: bool) (RO) (LocalName: Lock position) = 0
MTextJustify (type: AcDbAttDef::MTextJustity) (LocalName: Justify) = Failed to get value
MatchOrientationToLayout (type: bool) (LocalName: Match orientation to layout) = Failed to get value
MaterialId (type: AcDbObjectId) (LocalName: Material) = Failed to get value
MergeStyle (type: AcDb::DuplicateRecordCloning) (RO) = 1
ModelTextHeight (type: double) (LocalName: Model text height) = Failed to get value
Normal/X (type: double) = 0.000000
Normal/Y (type: double) = 0.000000
Normal/Z (type: double) = 1.000000
ObjectId (type: AcDbObjectId) (RO) = 1cee5eabf00
Oblique (type: double) (LocalName: Obliquing) = 0.000000
OwnerId (type: AcDbObjectId) (RO) = 1cee5eab9f0
PaperTextHeight (type: double) (LocalName: Paper text height) = Failed to get value
PlotStyleName (type: AcString) (RO) (LocalName: Plot style) = ByColor
Position/X (type: double) (RO) (LocalName: Position X) = Failed to get value
Position/Y (type: double) (RO) (LocalName: Position Y) = Failed to get value
Position/Z (type: double) (RO) (LocalName: Position Z) = Failed to get value
ReceiveShadows (type: bool) = 0
Rotation (type: double) (LocalName: Rotation) = 0.000000
ShadowDisplay (type: AcDb::ShadowFlags) (RO) (LocalName: Shadow Display) = Failed to get value
Tag (type: AcString) (RO) (LocalName: Tag) = DELIM20
TextString (type: AcString) = -
TextStyleId (type: AcDbObjectId) (LocalName: Style) = 1cee5ec0ea0
Thickness (type: double) (LocalName: Thickness) = Failed to get value
Transparency (type: AcCmTransparency) (LocalName: Transparency) = Failed to get value
Value (type: AcString) (LocalName: Value) = -
VerticalMode (type: AcDb::TextVertMode) = 2
Visible (type: AcDb::Visibility) = 0
Width (type: double) (RO) (LocalName: Multiline text width) = 0.000000
WidthFactor (type: double) (LocalName: Width factor) = 1.000000
End object dump
Solved! Go to Solution.