Hi,
What else do we need to do other than creating the needed Attribute References for the required attributes and wire connections for a custom symbol created by code?
I have a symbol with all four wire connection related attributes (TERM.. and X.TERM..), but it does not auto connect to wires when using it.
Thanks,
Before learning how to do this programmatically, you need to learn how to do it manually. I will move this to the acade forum for you to find out how.
There's a naming convention for the blocks also:
https://help.autodesk.com/view/ACAD_E/2023/ENU/?guid=GUID-426D2FCD-D82A-4FB7-A657-28D8B2EC336D
I do know how to create AutoCAD Electrical symbols manually and how to create AutoCAD blocks programmatically.
The question is what specific attribute definitions or attribute references we need to add to the AutoCAD blocks in the program to make the block work as AutoCAD Electrical symbols.
E.g. the attributes I highlighted in the starting post.
@TXACDE24 wrote:I do know how to create AutoCAD Electrical symbols manually and how to create AutoCAD blocks programmatically.
The question is what specific attribute definitions or attribute references we need to add to the AutoCAD blocks in the program to make the block work as AutoCAD Electrical symbols.
E.g. the attributes I highlighted in the starting post.
Like what please? your posts to date are not specific, too generic.
A sample DWG with one or more of your blocks in it with an explanation inside that file how you wish to use it in detail might help others help you 'specifically'.
TIA
The help files happens to mention what attributes that are needed, and what they're supposed to be named also:
AutoCAD Electrical 2023 Help | About Schematic Attributes | Autodesk
Thank you for this link to the help file I have been looking for this as well!!!
Like the Wire Connection attributes (TERM01 and TERM02). I created TERM01/TERM02 and X4TERM01/X1TERM02 block references, but they still are regular attributes instead of real "Wire Connections" when placed in AutoCAD Electrical drawings.
Hi @TXACDE24
I wrote a similar program a while ago that does symbol building but much faster than the symbol builder. One click place all required attributes at auto calculated positions.
I used the standard entmake to create all the attributes and as long as the symbol is saved using the correct naming convention, the symbol works like any other ACE symbol.
(entmake ; Create a new entity in the drawing
(list
(cons 0 "ATTDEF") ; Entity type: Attribute Definition
(cons 1 AttributeDefaultValue) ; Default value: EmTopManualPTY String
(cons 2 (nth index AttributesList)) ; Tag string: From List
(cons 3 "") ; Prompt string: EmTopManualPTY String
(cons 8 "0") ; Layer name: Layer 0
(cons 10 '(0.0 0.0 0.0)) ; Insertion point: 0,0,0
(cons 11 (list xCoord yCoord zCoord)) ; Insertion point: User Specified
(cons 70 AttributeVisibility) ; Attribute flags: 0 (Visible) 1 (Invisible)
(cons 72 1) ; Horizontal Justification: 1 (Center)
(cons 74 0) ; Vertical Justification: 0 (Not Specified)
(cons 40 (atof AttributesHeight)) ; Text height: User Specified
)
)
(terpri) ; Command Line Carriage Return
(princ (strcat "Attribute Inserted: " (nth index AttributesList))) ; Print Attribute Inserted: Name to Command Line
(terpri)
With regards to making the wire connections manually, You seems to be doing it correctly.
I inserted the attributes in a regular drawing with standard ATTDEF command and and created a BLOCK (without symbol builder as you would do with a program) and AutoCAD seems to recognize it no problem.
One of the most common problem that many users runs into is that forget to purge the drawing before trying out a new instance of the same Block. Make sure you are purging the block or trying it on an fresh new drawing.
Second thing to verify would be the Symbol naming convention.
https://help.autodesk.com/view/ACAD_E/2022/ENU/?guid=GUID-426D2FCD-D82A-4FB7-A657-28D8B2EC336D
And the last thing is to be mindful about the XTERM attributes which is where the wire connections are made (the green x shown while running wire command). Make sure everything is on layer "0" as well.
For Left Connections: TERMxx and X4TERMxx attribute
For Right Connections: TERMxx and X1TERMxx attribute
For Top Connections: TERMxx and X2TERMxx attribute
For Bottom Connections: TERMxx and X8TERMxx attribute
Can't find what you're looking for? Ask the community or share your knowledge.